sinatra_more 0.3.34 → 0.3.35

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.34
1
+ 0.3.35
@@ -1,4 +1,3 @@
1
- clear_sources
2
1
  source 'http://gemcutter.org'
3
2
  # Base requirements
4
3
  gem 'sinatra'
@@ -6,6 +5,7 @@ gem 'sinatra_more'
6
5
  gem 'rack-flash'
7
6
  gem 'warden'
8
7
  gem 'bcrypt-ruby', :require => 'bcrypt'
8
+ gem 'actionmailer', :require => 'action_mailer'
9
9
 
10
10
  # Component requirements
11
11
 
@@ -0,0 +1,5 @@
1
+ app do
2
+ get '/' do
3
+ "<strong>Hello World</strong> (checkout <em>app/routes/main.rb</em> to change this response)"
4
+ end
5
+ end
@@ -26,10 +26,10 @@ class <%= @class_name %> < Sinatra::Application
26
26
  set :environment, RACK_ENV.to_sym if defined?(RACK_ENV)
27
27
 
28
28
  # Attempts to require all dependencies with bundler, if this fails, bundle and then try again
29
- def self.bundler_require_dependencies(environment=nil)
29
+ def self.bundler_require_dependencies(environment='default')
30
30
  require 'bundler'
31
- require File.expand_path(File.join(File.dirname(__FILE__), '/../vendor', 'gems', 'environment'))
32
- Bundler.require_env(environment)
31
+ Bundler.setup(environment.to_sym)
32
+ Bundler.require(environment.to_sym)
33
33
  rescue LoadError => e
34
34
  puts "Bundler must be run to resolve dependencies!"
35
35
  system("cd #{ROOT_DIR}; bundle install")
@@ -13,10 +13,10 @@ module SinatraMore
13
13
  # insert_into_gemfile(name, :group => :testing)
14
14
  def insert_into_gemfile(name, options={})
15
15
  after_pattern = "# Component requirements\n"
16
- after_pattern = "# #{options[:group].to_s.capitalize} requirements\n" if environment = options[:group]
16
+ after_pattern = "# #{options[:group].to_s.capitalize} requirements\n" if group = options[:group]
17
17
  include_text = "gem '#{name}'"
18
18
  include_text << ", :require => #{options[:require].inspect}" if options[:require]
19
- include_text << ", :group => #{environment.inspect}" if environment
19
+ include_text << ", :group => #{group.inspect}" if group
20
20
  include_text << "\n"
21
21
  options.merge!(:content => include_text, :after => after_pattern)
22
22
  inject_into_file('Gemfile', options[:content], :after => options[:after])
@@ -7,21 +7,21 @@ module ActiveRecordInitializer
7
7
  app.configure :development do
8
8
  ActiveRecord::Base.establish_connection(
9
9
  :adapter => 'sqlite3',
10
- :database => 'your_dev_db_here'
10
+ :database => ":memory:"
11
11
  )
12
12
  end
13
13
 
14
14
  app.configure :production do
15
15
  ActiveRecord::Base.establish_connection(
16
16
  :adapter => 'sqlite3',
17
- :database => 'your_production_db_here'
17
+ :database => ":memory:"
18
18
  )
19
19
  end
20
20
 
21
21
  app.configure :test do
22
22
  ActiveRecord::Base.establish_connection(
23
23
  :adapter => 'sqlite3',
24
- :database => 'your_test_db_here'
24
+ :database => ":memory:"
25
25
  )
26
26
  end
27
27
  end
@@ -4,9 +4,9 @@ module SinatraMore
4
4
  DM = <<-DM
5
5
  module DataMapperInitializer
6
6
  def self.registered(app)
7
- app.configure(:development) { DataMapper.setup(:default, 'your_dev_db_here') }
8
- app.configure(:production) { DataMapper.setup(:default, 'your_production_db_here') }
9
- app.configure(:test) { DataMapper.setup(:default, 'your_test_db_here') }
7
+ app.configure(:development) { DataMapper.setup(:default, 'sqlite3::memory:') }
8
+ app.configure(:production) { DataMapper.setup(:default, 'sqlite3::memory:') }
9
+ app.configure(:test) { DataMapper.setup(:default, 'sqlite3::memory:') }
10
10
  end
11
11
  end
12
12
  DM
@@ -44,7 +44,7 @@ User.auto_upgrade!
44
44
  USER
45
45
 
46
46
  def setup_orm
47
- require_dependencies 'dm-core', 'dm-validations'
47
+ require_dependencies 'data_objects', 'do_sqlite3', 'dm-core', 'dm-validations'
48
48
  create_file("config/initializers/data_mapper.rb", DM)
49
49
  create_file("app/models/user.rb", USER)
50
50
  end
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.34"
8
+ s.version = "0.3.35"
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"]
@@ -38,6 +38,7 @@ Gem::Specification.new do |s|
38
38
  "generators/base_app/app/mailers/.empty_directory",
39
39
  "generators/base_app/app/models/.empty_directory",
40
40
  "generators/base_app/app/routes/.empty_directory",
41
+ "generators/base_app/app/routes/main.rb.tt",
41
42
  "generators/base_app/app/views/.empty_directory",
42
43
  "generators/base_app/config.ru.tt",
43
44
  "generators/base_app/config/boot.rb.tt",
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.34
4
+ version: 0.3.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Esquenazi
@@ -141,6 +141,7 @@ files:
141
141
  - generators/base_app/app/mailers/.empty_directory
142
142
  - generators/base_app/app/models/.empty_directory
143
143
  - generators/base_app/app/routes/.empty_directory
144
+ - generators/base_app/app/routes/main.rb.tt
144
145
  - generators/base_app/app/views/.empty_directory
145
146
  - generators/base_app/config.ru.tt
146
147
  - generators/base_app/config/boot.rb.tt