padrino-gen 0.7.4 → 0.7.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.4
1
+ 0.7.5
data/lib/padrino-gen.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'thor/group'
1
2
  require 'padrino-core/support_lite'
2
3
  require 'padrino-core/version'
3
4
  require 'padrino-gen/generators'
@@ -1,6 +1,8 @@
1
1
  module Padrino
2
2
  module Generators
3
3
 
4
+ DEV_PATH = File.expand_path("../../../", File.dirname(__FILE__))
5
+
4
6
  class << self
5
7
  def load_paths
6
8
  @load_paths ||= Dir[File.dirname(__FILE__) + '/generators/{app,mailer,controller,model,migration}.rb']
@@ -90,7 +90,7 @@ module Padrino
90
90
 
91
91
  # Adds all the specified gems into the Gemfile for bundler
92
92
  # require_dependencies 'active_record'
93
- # require_dependencies 'mocha', 'bacon', :group => :testing
93
+ # require_dependencies 'mocha', 'bacon', :group => :test
94
94
  def require_dependencies(*gem_names)
95
95
  options = gem_names.extract_options!
96
96
  gem_names.reverse.each { |lib| insert_into_gemfile(lib, options) }
@@ -98,7 +98,7 @@ module Padrino
98
98
 
99
99
  # Inserts a required gem into the Gemfile to add the bundler dependency
100
100
  # insert_into_gemfile(name)
101
- # insert_into_gemfile(name, :group => :testing, :require => 'foo')
101
+ # insert_into_gemfile(name, :group => :test, :require => 'foo')
102
102
  def insert_into_gemfile(name, options={})
103
103
  after_pattern = options[:group] ? "#{options[:group].to_s.capitalize} requirements\n" : "Component requirements\n"
104
104
  gem_options = options.slice(:group, :require).collect { |k, v| "#{k.inspect} => #{v.inspect}" }.join(", ")
@@ -18,8 +18,9 @@ module Padrino
18
18
 
19
19
  argument :name, :desc => "The name of your padrino project"
20
20
 
21
- class_option :run_bundler, :aliases => '-b', :default => false, :type => :boolean
22
- class_option :root, :desc => "The root destination", :aliases => '-r', :default => ".", :type => :string
21
+ class_option :run_bundler, :desc => "Run 'bundle install'", :aliases => '-b', :default => false, :type => :boolean
22
+ class_option :root, :desc => "The root destination", :aliases => '-r', :default => ".", :type => :string
23
+ class_option :dev, :desc => "Use padrino from a git checkout", :default => false, :type => :boolean
23
24
 
24
25
  # Definitions for the available customizable components
25
26
  component_option :orm, "database engine", :aliases => '-d', :choices => [:datamapper, :mongomapper, :activerecord, :sequel, :couchrest]
@@ -1,10 +1,19 @@
1
- # AUTOGENERATED FILE -- Don't change this file unless you know what you are doing!
1
+ # Defines our constants
2
+ PADRINO_ENV = ENV["PADRINO_ENV"] ||= ENV["RACK_ENV"] ||= "development" unless defined?(PADRINO_ENV)
2
3
  PADRINO_ROOT = File.dirname(__FILE__) + '/..' unless defined? PADRINO_ROOT
3
4
 
4
- # Try to load the vendorized padrino.
5
- Dir[PADRINO_ROOT + "/vendor/padrino/**/lib"].each do |gem|
6
- $:.unshift gem
5
+ begin
6
+ # Require the preresolved locked set of gems.
7
+ require File.expand_path('../../.bundle/environment', __FILE__)
8
+ require 'padrino'
9
+ rescue LoadError
10
+ # Fallback on doing the resolve at runtime.
11
+ require 'rubygems'
12
+ require 'bundler'
13
+ Bundler.setup
7
14
  end
8
15
 
9
- require 'padrino'
16
+ Bundler.require :default, PADRINO_ENV
17
+ puts "=> Located #{Padrino.bundle} Gemfile for #{Padrino.env} with #{Padrino.support.to_s.humanize}"
18
+
10
19
  Padrino.load!
@@ -5,7 +5,7 @@ module Padrino
5
5
 
6
6
  module MochaGen
7
7
  def setup_mock
8
- require_dependencies 'mocha', :group => :testing
8
+ require_dependencies 'mocha', :group => :test
9
9
  insert_mocking_include "Mocha::API", :path => "test/test_config.rb"
10
10
  end
11
11
  end
@@ -5,7 +5,7 @@ module Padrino
5
5
 
6
6
  module RrGen
7
7
  def setup_mock
8
- require_dependencies 'rr', :group => :testing
8
+ require_dependencies 'rr', :group => :test
9
9
  insert_mocking_include "RR::Adapters::RRMethods", :path => "test/test_config.rb"
10
10
  end
11
11
  end
@@ -16,7 +16,7 @@ module Padrino
16
16
 
17
17
  # Setup the testing configuration helper and dependencies
18
18
  def setup_test
19
- require_dependencies 'bacon', :group => :testing
19
+ require_dependencies 'bacon', :group => :test
20
20
  insert_test_suite_setup BACON_SETUP
21
21
  end
22
22
 
@@ -15,7 +15,7 @@ module Padrino
15
15
  TEST
16
16
 
17
17
  def setup_test
18
- require_dependencies 'riot', :group => :testing
18
+ require_dependencies 'riot', :group => :test
19
19
  insert_test_suite_setup RIOT_SETUP
20
20
  end
21
21
 
@@ -16,7 +16,7 @@ module Padrino
16
16
 
17
17
  # TODO move to spec directory to follow convention
18
18
  def setup_test
19
- require_dependencies 'rspec', :group => :testing, :require => 'spec'
19
+ require_dependencies 'rspec', :group => :test, :require => 'spec'
20
20
  insert_test_suite_setup RSPEC_SETUP
21
21
  end
22
22
 
@@ -15,7 +15,7 @@ module Padrino
15
15
  TEST
16
16
 
17
17
  def setup_test
18
- require_dependencies 'shoulda', :group => :testing
18
+ require_dependencies 'shoulda', :group => :test
19
19
  insert_test_suite_setup SHOULDA_SETUP
20
20
  end
21
21
 
@@ -15,7 +15,7 @@ module Padrino
15
15
  TEST
16
16
 
17
17
  def setup_test
18
- require_dependencies 'test/spec', :group => :testing
18
+ require_dependencies 'test/spec', :group => :test
19
19
  insert_test_suite_setup TESTSPEC_SETUP
20
20
  end
21
21
 
@@ -2,11 +2,20 @@ source 'http://gemcutter.org'
2
2
 
3
3
  # Project requirements
4
4
  gem 'sinatra', :require => 'sinatra/base'
5
- gem 'padrino', "<%= Padrino.version %>"
6
5
  gem 'rack-flash'
7
6
  gem 'thin' # or mongrel
8
7
 
9
8
  # Component requirements
10
9
 
11
- # Testing requirements
12
- gem 'rack-test', :require => 'rack/test', :group => :testing
10
+ # Test requirements
11
+ gem 'rack-test', :require => 'rack/test', :group => :test
12
+
13
+ <%- if options.dev? -%>
14
+ # Vendored Padrino
15
+ %w(core gen helpers mailer admin).each do |gem|
16
+ gem 'padrino-' + gem, :path => "<%= Padrino::Generators::DEV_PATH %>/padrino-" + gem
17
+ end
18
+ <%- else -%>
19
+ # Padrino
20
+ gem 'padrino', "<%= Padrino.version %>"
21
+ <%- end -%>
data/padrino-gen.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{padrino-gen}
8
- s.version = "0.7.4"
8
+ s.version = "0.7.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
12
- s.date = %q{2010-02-08}
12
+ s.date = %q{2010-02-09}
13
13
  s.default_executable = %q{padrino-gen}
14
14
  s.description = %q{Generators for easily creating and building padrino applications from the console}
15
15
  s.email = %q{padrinorb@gmail.com}
@@ -99,7 +99,7 @@ Gem::Specification.new do |s|
99
99
 
100
100
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
101
101
  s.add_runtime_dependency(%q<sinatra>, [">= 0.9.2"])
102
- s.add_runtime_dependency(%q<padrino-core>, ["= 0.7.4"])
102
+ s.add_runtime_dependency(%q<padrino-core>, ["= 0.7.5"])
103
103
  s.add_runtime_dependency(%q<thor>, [">= 0.13.0"])
104
104
  s.add_runtime_dependency(%q<bundler>, [">= 0.9.3"])
105
105
  s.add_development_dependency(%q<haml>, [">= 2.2.1"])
@@ -110,7 +110,7 @@ Gem::Specification.new do |s|
110
110
  s.add_development_dependency(%q<fakeweb>, [">= 1.2.3"])
111
111
  else
112
112
  s.add_dependency(%q<sinatra>, [">= 0.9.2"])
113
- s.add_dependency(%q<padrino-core>, ["= 0.7.4"])
113
+ s.add_dependency(%q<padrino-core>, ["= 0.7.5"])
114
114
  s.add_dependency(%q<thor>, [">= 0.13.0"])
115
115
  s.add_dependency(%q<bundler>, [">= 0.9.3"])
116
116
  s.add_dependency(%q<haml>, [">= 2.2.1"])
@@ -122,7 +122,7 @@ Gem::Specification.new do |s|
122
122
  end
123
123
  else
124
124
  s.add_dependency(%q<sinatra>, [">= 0.9.2"])
125
- s.add_dependency(%q<padrino-core>, ["= 0.7.4"])
125
+ s.add_dependency(%q<padrino-core>, ["= 0.7.5"])
126
126
  s.add_dependency(%q<thor>, [">= 0.13.0"])
127
127
  s.add_dependency(%q<bundler>, [">= 0.9.3"])
128
128
  s.add_dependency(%q<haml>, [">= 2.2.1"])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2010-02-08 00:00:00 +01:00
15
+ date: 2010-02-09 00:00:00 +01:00
16
16
  default_executable: padrino-gen
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
@@ -33,7 +33,7 @@ dependencies:
33
33
  requirements:
34
34
  - - "="
35
35
  - !ruby/object:Gem::Version
36
- version: 0.7.4
36
+ version: 0.7.5
37
37
  version:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: thor