diesel 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'diesel/commands'
4
+
@@ -0,0 +1,46 @@
1
+ @disable-bundler
2
+ Feature: use Rails rake tasks when developing a diesel application
3
+
4
+ Scenario: create a disel engine and use Rails rake tasks
5
+ Given a directory named "testengine"
6
+ When I cd to "testengine"
7
+ And I write to "Gemfile" with:
8
+ """
9
+ gem "rspec-rails", "~> 2.3.0"
10
+ gem "rails", "~> 3.0.3"
11
+ gem "sqlite3-ruby"
12
+ """
13
+ When I add this library as a dependency
14
+ And I run "bundle install --local"
15
+ And I write to "Rakefile" with:
16
+ """
17
+ require 'rubygems'
18
+ require 'bundler/setup'
19
+ require 'diesel/tasks'
20
+ """
21
+ When I successfully run "bundle exec diesel generate model post title:string"
22
+ And I write to "spec/models/post_spec.rb" with:
23
+ """
24
+ ENV["RAILS_ENV"] ||= 'test'
25
+ require "diesel/testing"
26
+ require 'rspec/rails'
27
+
28
+ describe Post do
29
+ it "has a title" do
30
+ Post.new.should respond_to(:title)
31
+ end
32
+ end
33
+ """
34
+ When I write to "app/models/post.rb" with:
35
+ """
36
+ class Post < ActiveRecord::Base
37
+ end
38
+ """
39
+ When I successfully run "rake db:create db:migrate db:schema:dump db:test:prepare"
40
+ And I run "bundle exec rspec --format documentation spec"
41
+ Then it should pass with:
42
+ """
43
+ 0 failures
44
+ """
45
+ Then at least one example should have run
46
+
@@ -0,0 +1,4 @@
1
+ APP_PATH = "diesel/testing"
2
+ require 'bundler/setup'
3
+ require 'rails/commands'
4
+
@@ -0,0 +1,4 @@
1
+ require 'rake'
2
+ require 'diesel/testing/application'
3
+
4
+ Diesel::Testing::Application.load_tasks
@@ -21,6 +21,15 @@ module Diesel
21
21
  config.action_mailer.delivery_method = :test
22
22
  config.active_support.deprecation = :stderr
23
23
  config.secret_token = "DIESEL" * 5 # so diesel
24
+
25
+ def require_environment!
26
+ initialize!
27
+ end
28
+
29
+ def initialize!
30
+ FileUtils.mkdir_p(Rails.root.join("db").to_s)
31
+ super
32
+ end
24
33
  end
25
34
  end
26
35
  end
@@ -1,6 +1,12 @@
1
- test: &test
1
+ development:
2
2
  adapter: sqlite3
3
- database: tmp/test.sqlite3
3
+ database: db/development.sqlite3
4
+ pool: 5
5
+ timeout: 5000
6
+
7
+ test:
8
+ adapter: sqlite3
9
+ database: db/test.sqlite3
4
10
  pool: 5
5
11
  timeout: 5000
6
12
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diesel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - thoughtbot, inc.
@@ -16,8 +16,8 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-01-10 00:00:00 -05:00
20
- default_executable:
19
+ date: 2011-01-11 00:00:00 -05:00
20
+ default_executable: diesel
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  type: :runtime
@@ -37,8 +37,8 @@ dependencies:
37
37
  requirement: *id001
38
38
  description: Develop your Rails engines like you develop your Rails applications.
39
39
  email: support@thoughtbot.com
40
- executables: []
41
-
40
+ executables:
41
+ - diesel
42
42
  extensions: []
43
43
 
44
44
  extra_rdoc_files: []
@@ -47,10 +47,12 @@ files:
47
47
  - Gemfile
48
48
  - Gemfile.lock
49
49
  - Rakefile
50
+ - lib/diesel/commands.rb
50
51
  - lib/diesel/generators/base.rb
51
52
  - lib/diesel/generators/features_base.rb
52
53
  - lib/diesel/generators/install_base.rb
53
54
  - lib/diesel/generators/views_base.rb
55
+ - lib/diesel/tasks.rb
54
56
  - lib/diesel/testing/app/controllers/application_controller.rb
55
57
  - lib/diesel/testing/app/views/layouts/application.html.erb
56
58
  - lib/diesel/testing/application.rb
@@ -63,10 +65,12 @@ files:
63
65
  - features/features_generator.feature
64
66
  - features/install_generator.feature
65
67
  - features/integration_testing.feature
68
+ - features/rails_rake_tasks_and_generators.feature
66
69
  - features/rspec_testing.feature
67
70
  - features/step_definitions/diesel_steps.rb
68
71
  - features/support/env.rb
69
72
  - features/views_generator.feature
73
+ - bin/diesel
70
74
  has_rdoc: false
71
75
  homepage: http://github.com/thoughtbot/diesel
72
76
  licenses: []
@@ -107,6 +111,7 @@ test_files:
107
111
  - features/features_generator.feature
108
112
  - features/install_generator.feature
109
113
  - features/integration_testing.feature
114
+ - features/rails_rake_tasks_and_generators.feature
110
115
  - features/rspec_testing.feature
111
116
  - features/step_definitions/diesel_steps.rb
112
117
  - features/support/env.rb