-
Notifications
You must be signed in to change notification settings - Fork 11
AboutGem assignment submission. #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
gem 'sinatra' | ||
gem 'sinatra-contrib' | ||
gem 'shotgun' | ||
gem 'about_drammopo', '~> 0.1.0', github: 'drammopo/about_drammopo' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use here to load the gem directly from github. You'll use this when you fork a repository.
Great job! |
@jwo Awesome! On to the Eagle level. I'm not too sure where to start but On Monday, March 17, 2014, Jesse Wolgamott [email protected] wrote:
"When you are tired of being yourself then you can be ordinary." - dudu |
Devise is a Rails engine (so has to be used in Rails), and it's extremely complicated. I have not used this, but it looks useful for sinatra and activerecord: https://github.com/janko-m/sinatra-activerecord |
@jwo I'm all over the place as far as implementing the Eagle level. |
Adventure gem looks great. Other devs have used it as ActiveRecord, though it looks like you're using it as more just ruby classes. Either work. |
@jwo I'm trying to do the same...use it as ActiveRecord. How do I overcome this error? On 19 March 2014 19:57, Jesse Wolgamott [email protected] wrote:
"When you are tired of being yourself then you can be ordinary." - dudu |
Why do you do this? https://github.com/drammopo/adventure/blob/master/lib/adventure.rb#L4 require “active_record" Jesse Wolgamott @ Comal Productions, Inc. On Wednesday, March 19, 2014 at 3:58 PM, drammopo wrote:
|
Another possibility: You did not edit your gemspec, you edited your Gemfile on the gem itself. So, it will not install that when you use it. Nothing is loading ActiveRecord because you haven’t told it that it needed to be loaded. Jesse Wolgamott @ Comal Productions, Inc. On Wednesday, March 19, 2014 at 4:01 PM, Jesse Wolgamott wrote:
|
@jwo Remembered that you can load dependencies as:
Still have the same error.... |
@jwo Changed page.rb to
Gettting a "better" error in that the specs run....with the error ActiveRecord::ConnectionNotEstablished |
@jwo In Episode3, we have a db directory which uses db/migrate/...rb , seed.rb and setup.rb files to initialize the app. |
With eagle assignments, there's no "should"..... You need to be 100% sure on the load order:
On Wed, Mar 19, 2014 at 4:56 PM, drammopo [email protected]
|
@jwo Do. Or do not. There is no try? |
🤘 On Wed, Mar 19, 2014 at 5:15 PM, drammopo [email protected]
|
@jwo Been struggling with the Eagle level for sometime. I'd like to run the tasks below in order to bootstrap the gem within the Sinatra app....(but I think it impossible) Can I have custom tasks as above? |
So let's say you wanted to have rake adventure:migrate
rake adventure:seed This is possible! In here (https://github.com/drammopo/adventure/tree/master/lib) you need a "tasks" directory, with a You'll instruct your clients to See also: You'll see this is pretty much exactly what is done here https://github.com/janko-m/sinatra-activerecord |
@jwo Thanks for the clues. My latest version of the gem is up.
At the moment everything seems to work...fine. |
This is a model that is backed by a database module Adventure
class Page < ActiveRecord::Base
end
end This is a plain ruby class, without a database table behind it module Adventure
class Book
end
end If you do not add your classes to a module, they exist in a global namespace. So, let's say you have an But, if you have |
@jwo Makes perfect sense. |
@jwo From :http://blog.smartlogicsolutions.com/2009/05/26/including-external-rake-files-in-your-projects-rakefile-keep-your-rake-tasks-organized/ Rake assumes the ‘require’d files end in .rb, so it won’t find your .rake files. You need to import rake files:
This is fine for individual files, but I wanted to include all files that end in .rake in my tasks dir:
…and there you go. |
@jwo Seems this is the way to go about it.. |
Dir.glob('tasks/*.rake').each { |r| import r } Perfect!
Yep. good choice. |
@jwo Sucker for punishment that I am...I kinda started but will stop while I'm ahead! |
@jwo Completed the Panda and Tiger level.
The app is hosted here: http://obscure-badlands-2253.herokuapp.com/