sinatra_more 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -580,7 +580,7 @@ The available components and their default options are listed below:
580
580
  * renderer: <tt>erb</tt> (default), <tt>haml</tt>
581
581
  * mock: <tt>mocha</tt> (default), <tt>rr</tt>
582
582
  * script: <tt>jquery</tt> (default), <tt>prototype</tt>, <tt>rightjs</tt>
583
- * orm: <tt>sequel</tt> (default), <tt>datamapper</tt>, <tt>mongomapper</tt>, <tt>activerecord</tt>
583
+ * orm: <tt>datamapper</tt> (default), <tt>mongomapper</tt>, <tt>activerecord</tt>, <tt>sequel</tt>
584
584
 
585
585
  The generator framework within sinatra_more is highly extensible and additional components and tools can easily be added.
586
586
  This would be achieved through forking our project and reading through the code in <tt>/generators/sinatra_generator.rb</tt> and
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -26,12 +26,4 @@ class <%= @class_name %> < Sinatra::Application
26
26
 
27
27
  # Dependencies contains all required gems and core configuration
28
28
  require File.dirname(__FILE__) + '/dependencies.rb'
29
-
30
- # Requires the initializer modules which configure specific components
31
- Dir[File.dirname(__FILE__) + '/initializers/*.rb'].each do |file|
32
- # Each initializer file contains a module called 'XxxxInitializer' (i.e HassleInitializer)
33
- require file
34
- file_class = File.basename(file, '.rb').classify
35
- register "#{file_class}Initializer".constantize
36
- end
37
29
  end
@@ -7,6 +7,14 @@ class <%= @class_name %> < Sinatra::Application
7
7
  use Rack::Session::Cookie
8
8
  use Rack::Flash
9
9
 
10
+ # Requires the initializer modules which configure specific components
11
+ Dir[File.dirname(__FILE__) + '/initializers/*.rb'].each do |file|
12
+ # Each initializer file contains a module called 'XxxxInitializer' (i.e HassleInitializer)
13
+ require file
14
+ file_class = File.basename(file, '.rb').classify
15
+ register "#{file_class}Initializer".constantize
16
+ end
17
+
10
18
  # Returns the list of load paths for this sinatra application
11
19
  def self.file_loading_paths
12
20
  ["lib/**/*.rb", "app/helpers/**/*.rb", "app/routes/**/*.rb", "app/models/*.rb"]
@@ -1,5 +1,5 @@
1
1
  RACK_ENV = ENV["RACK_ENV"] ||= "development" unless defined? RACK_ENV
2
- ROOT_DIR = $0.gsub(%r{^.*?/}, '/') unless defined? ROOT_DIR
2
+ ENV['DATABASE_URL'] = 'your_database_here'
3
3
 
4
4
  require File.dirname(__FILE__) + '/app.rb'
5
5
 
@@ -8,6 +8,4 @@ log = File.new("log/sinatra.log", "a")
8
8
  $stdout.reopen(log)
9
9
  $stderr.reopen(log)
10
10
 
11
- ENV['DATABASE_URL'] = 'your_database_here'
12
-
13
11
  run <%= @class_name %>
@@ -6,7 +6,7 @@ module SinatraMore
6
6
  def insert_require(*libs)
7
7
  options = libs.extract_options!
8
8
  options.reverse_merge!(:indent => 0, :after => /require\sgem.*?\n/)
9
- multiple_gem_require = "%w[#{libs.join(' ')}].each { |gem| require gem }\n"
9
+ multiple_gem_require = "%w[#{libs.join(' ')}].each { |lib| require lib }\n"
10
10
  req = indent_spaces(options[:indent]) + (libs.size == 1 ? "require '#{libs}'\n" : multiple_gem_require)
11
11
  inject_into_file(options[:path], req, :after => options[:after])
12
12
  end
@@ -19,7 +19,7 @@ module SinatraMore
19
19
  argument :path, :desc => "The path to create your app"
20
20
 
21
21
  # Definitions for the available customizable components
22
- component_option :orm, "database engine", :aliases => '-d', :choices => [:sequel, :datamapper, :mongomapper, :activerecord]
22
+ component_option :orm, "database engine", :aliases => '-d', :choices => [:datamapper, :mongomapper, :activerecord, :sequel]
23
23
  component_option :test, "testing framework", :aliases => '-t', :choices => [:bacon, :shoulda, :rspec, :testspec, :riot]
24
24
  component_option :mock, "mocking library", :aliases => '-m', :choices => [:mocha, :rr]
25
25
  component_option :script, "javascript library", :aliases => '-s', :choices => [:jquery, :prototype, :rightjs]
data/sinatra_more.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sinatra_more}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan Esquenazi"]
@@ -17,7 +17,7 @@ class TestSkeletonGenerator < Test::Unit::TestCase
17
17
  should "create components file containing options chosen with defaults" do
18
18
  silence_logger { SinatraMore::SkeletonGenerator.start(['sample_app', '/tmp']) }
19
19
  components_chosen = YAML.load_file('/tmp/sample_app/.components')
20
- assert_equal 'sequel', components_chosen[:orm]
20
+ assert_equal 'datamapper', components_chosen[:orm]
21
21
  assert_equal 'bacon', components_chosen[:test]
22
22
  assert_equal 'mocha', components_chosen[:mock]
23
23
  assert_equal 'jquery', components_chosen[:script]
@@ -62,7 +62,7 @@ class TestSkeletonGenerator < Test::Unit::TestCase
62
62
 
63
63
 
64
64
  context "the generator for orm components" do
65
- should "properly generate default for sequel" do
65
+ should "properly generate for sequel" do
66
66
  SinatraMore::SkeletonGenerator.instance_eval("undef setup_orm if respond_to?('setup_orm')")
67
67
  buffer = silence_logger { SinatraMore::SkeletonGenerator.start(['sample_app', '/tmp', '--orm=sequel', '--script=none']) }
68
68
  assert_match /Applying.*?sequel.*?orm/, buffer
@@ -80,7 +80,7 @@ class TestSkeletonGenerator < Test::Unit::TestCase
80
80
  assert_match_in_file(/class User < ActiveRecord::Base/, '/tmp/sample_app/app/models/user.rb')
81
81
  end
82
82
 
83
- should "properly generate for datamapper" do
83
+ should "properly generate default for datamapper" do
84
84
  buffer = silence_logger { SinatraMore::SkeletonGenerator.start(['sample_app', '/tmp', '--orm=datamapper', '--script=none']) }
85
85
  assert_match /Applying.*?datamapper.*?orm/, buffer
86
86
  assert_match_in_file(/require 'dm-core'/, '/tmp/sample_app/config/dependencies.rb')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra_more
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Esquenazi