Using gem in rails application

Hello Experts,

i am trying to use pulp gem on my ruby application, i did the gem installation and generated new scaffold, but i am not able to get how i can use that gem in my application ?

https://github.com/duritong/ruby-pulp

this is the guide ..but after reading that as well, i am not getting on how to update my controller and veiw so i can connect to pulp API. any guide and example will really appreciate and help me to learn.

Regards, DJ

Hello Experts,

i am trying to use pulp gem on my ruby application, i did the gem installation and generated new scaffold, but i am not able to get how i can use that gem in my application ?

GitHub - duritong/ruby-pulp: A ruby gem to talk to a pulp server using its REST-api

this is the guide ..but after reading that as well, i am not getting on how to update my controller and veiw so i can connect to pulp API. any guide and example will really appreciate and help me to learn.

Glancing through the documentation at Github, it appears as though this gem is a basic Ruby gem, as opposed to a Rails-specific Ruby gem. This means that you would need to add the hooks to your Rails application using traditional Ruby programming methods. You might want to refine your search to see if anyone else has already integrated this into a Rails project. First I've heard of Pulp, although it looks interesting and potentially useful.

Walter

Hi Walter,

i checked, nobody used it in rails .. there is new application katello, which is developed using rails no nobody developed any GUI for pulp...

but i am really not sure how can i integrate my rails application with this ..

is it possible to call pain ruby code from rails ? any docs you can suggest ?

Regards, Dj

You realize Rails is "plain ruby code"?

I'd recommend following a good Rails tutorial to start with, as well as some further study of the Ruby language.

I guess my first question is: if you don't know how or why'd you'd use something in a Rails application, why are you trying to make it work? What is your use case for using this gem in relationship to the rest of your Rails application? Is this something you plan on exposing to the users of your application? Is this something that you want to persist in your application? etc.etc.etc.

I wouldn't actually think generating Rails scaffolding in your application would be of any use in working with the Pulp API; such things are rather orthogonal. Tell us more about what you're actually trying to do, what you expect your application to do with the information, and how your app's users would interact with such information.

tamouse mailing lists wrote in post #1108475:

any guide and example will really appreciate and help me to learn.

I guess my first question is: if you don't know how or why'd you'd use something in a Rails application, why are you trying to make it work? What is your use case for using this gem in relationship to the rest of your Rails application? Is this something you plan on exposing to the users of your application? Is this something that you want to persist in your application? etc.etc.etc.

I wouldn't actually think generating Rails scaffolding in your application would be of any use in working with the Pulp API; such things are rather orthogonal. Tell us more about what you're actually trying to do, what you expect your application to do with the information, and how your app's users would interact with such information.

Hi,

Yes, i also thought that generating scaffolding will not help me .. this is what my plan is ..

-- Pulp is only command line application .. that has mongodb database i am trying to create GUI, there are nice API available to do all CRUD operation .. and i want to use those in my GUI application ..

-- though i want to create my own database for storing information and then call API to do Pulp task .

https://fedorahosted.org/pulp/wiki/UGREST-Packages

this is the API link ..

for example to Create .. i want to create form ..which takes all values from user and then store that values in mysql DB and then call pulp using API to complete pulp task.

Regards, DJ

Okay, cool, I can see now what you are thinking of.

Starting out, I'd make a module, gem, engine, whatever you choose, that just allows you to test out the API; keeping it in it's own space will help keep your application modular; you should consider the Pulp service and your API wrapper to be a separate service from the rest of your app, which it is. You don't need to worry about database models at this point unless they help you test your wrapper, and views can be very rudimentary (even displaying just structured JSON might be enough).

If, as you say, Pulp has the data base store, you don't need to replicated it in your application, merely interact with the Pulp to store and retrieve info.

However, if that *is* the case, and all you are doing is packaging up requests from a client, forming a Pulp API call, then doing something back to the user with the results, why not go with something like Sinatra, or another light-weight stack?

Okay, cool, I can see now what you are thinking of.

Starting out, I'd make a module, gem, engine, whatever you choose, that just allows you to test out the API; keeping it in it's own space will help keep your application modular; you should consider the Pulp service and your API wrapper to be a separate service from the rest of your app, which it is. You don't need to worry about database models at this point unless they help you test your wrapper, and views can be very rudimentary (even displaying just structured JSON might be enough).

Okay, I understand this, But do you know any application already written ... something similar, i can take example from ? ..

However, if that *is* the case, and all you are doing is packaging up requests from a client, forming a Pulp API call, then doing something back to the user with the results, why not go with something like Sinatra, or another light-weight stack?

by writing this, i want to understand rails concepts and at the same time help my users to provide some GUI .. i never looked at Sinatra . but i will try ..

but will be greatfull if you have some example ( it might doesnt make sense to ask you for example may be ..but nothing wrong in asking :slight_smile: )

Regards, DJ

If you are a beginner with Rails I strongly advise that you first work right through a good tutorial such as railstutorial.org (which is free to use online) first. The tutorial will show you the basics of Rails so that you may then go on to work out the best way to implement your app.

Colin

If you are a beginner with Rails I strongly advise that you first work right through a good tutorial such as railstutorial.org (which is free to use online) first. The tutorial will show you the basics of Rails so that you may then go on to work out the best way to implement your app.

Thanks Colin, that's the answer i always get from all forums most of the time, but i am not that beginner .. i am already handling some rails applications ( not written by me but still m able to make modifications .. ) .. But anyways .. Let's see .. Thanks..

Regards, DJ

OK, it was the fact you said "by writing this, i want to understand rails concepts" that made me think that you needed help with understanding the rails concepts.

Colin

Okay, cool, I can see now what you are thinking of.

Starting out, I'd make a module, gem, engine, whatever you choose, that just allows you to test out the API; keeping it in it's own space will help keep your application modular; you should consider the Pulp service and your API wrapper to be a separate service from the rest of your app, which it is. You don't need to worry about database models at this point unless they help you test your wrapper, and views can be very rudimentary (even displaying just structured JSON might be enough).

Okay, I understand this, But do you know any application already written ... something similar, i can take example from ? ..

Not offhand. I'm not really up to digging up examples for you, really.