engine_cart 1.1.0 → 1.2.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +11 -2
- data/README.md +1 -1
- data/lib/engine_cart/configuration.rb +13 -3
- data/lib/engine_cart/tasks/engine_cart.rake +1 -1
- data/lib/engine_cart/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8180b96510ff7c10e9a21625cca64768f90b52ee
|
4
|
+
data.tar.gz: 5872062cf96944e5ee713caf54dd49e8afe846e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64e60694001844c9c0f171dc72364740beae0395a331f65609c73911f508eb5c265ddc785882318799fef9831e8d07b92e58460529ea58c567148b37b1b3fecd
|
7
|
+
data.tar.gz: 71e3fdbff0b743638aa212a4cc9b2ec313dd00b6c6ad1f711bf649f304128ecf0821f2b18d9f5dfbd56f7db629322208ef0c58985e8e0c7c2c9680b177df8e7e
|
data/.travis.yml
CHANGED
@@ -1,7 +1,16 @@
|
|
1
1
|
language: ruby
|
2
2
|
sudo: false
|
3
3
|
rvm:
|
4
|
-
- 2.4.
|
4
|
+
- 2.4.1
|
5
|
+
|
6
|
+
matrix:
|
7
|
+
include:
|
8
|
+
- rvm: jruby-9.1.13.0
|
9
|
+
- rvm: 2.3.4
|
10
|
+
env: "RAILS_VERSION=5.0.6"
|
11
|
+
allow_failures:
|
12
|
+
- rvm: jruby-9.1.13.0
|
13
|
+
fast_finish: true
|
5
14
|
|
6
15
|
env:
|
7
|
-
- "RAILS_VERSION=5.
|
16
|
+
- "RAILS_VERSION=5.1.4"
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ Or install it yourself as:
|
|
32
32
|
|
33
33
|
### engine_cart rake tasks
|
34
34
|
|
35
|
-
To use engine_cart's rake tasks,
|
35
|
+
To use engine_cart's rake tasks, add the following to *your* engine's Rakefile (e.g. `your_engine/Rakefile`):
|
36
36
|
|
37
37
|
```ruby
|
38
38
|
require 'engine_cart/rake_task'
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'yaml'
|
2
|
+
require 'erb'
|
2
3
|
|
3
4
|
module EngineCart
|
4
5
|
class Configuration
|
@@ -50,7 +51,7 @@ module EngineCart
|
|
50
51
|
##
|
51
52
|
# Additional options when generating a test rails application
|
52
53
|
def rails_options
|
53
|
-
options[:rails_options]
|
54
|
+
Array(options[:rails_options])
|
54
55
|
end
|
55
56
|
|
56
57
|
def default_destination
|
@@ -73,10 +74,19 @@ module EngineCart
|
|
73
74
|
destination: ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || default_destination,
|
74
75
|
template: ENV['ENGINE_CART_TEMPLATE'],
|
75
76
|
templates_path: ENV['ENGINE_CART_TEMPLATES_PATH'] || './spec/test_app_templates',
|
76
|
-
rails_options: ENV['ENGINE_CART_RAILS_OPTIONS']
|
77
|
+
rails_options: parse_options(ENV['ENGINE_CART_RAILS_OPTIONS'])
|
77
78
|
}
|
78
79
|
end
|
79
80
|
|
81
|
+
# Split a string of options into individual options.
|
82
|
+
# @example
|
83
|
+
# parse_options('--skip-foo --skip-bar -d postgres --skip-lala')
|
84
|
+
# # => ["--skip-foo", "--skip-bar", "-d postgres", "--skip-lala"]
|
85
|
+
def parse_options(options)
|
86
|
+
return if options.nil?
|
87
|
+
options.scan(/(--[^\s]+|-[^\s]+\s+[^\s]+)/).flatten
|
88
|
+
end
|
89
|
+
|
80
90
|
def read_config(config_file)
|
81
91
|
$stdout.puts "Loading configuration from #{config_file}" if verbose?
|
82
92
|
config = YAML.load(ERB.new(IO.read(config_file)).result(binding))
|
@@ -95,4 +105,4 @@ module EngineCart
|
|
95
105
|
['~/.engine_cart.yml', '.engine_cart.yml']
|
96
106
|
end
|
97
107
|
end
|
98
|
-
end
|
108
|
+
end
|
@@ -36,7 +36,7 @@ namespace :engine_cart do
|
|
36
36
|
|
37
37
|
# Using the Rails generator directly, instead of shelling out, to
|
38
38
|
# ensure we use the right version of Rails.
|
39
|
-
Rails::Generators::AppGenerator.start(['internal', '--skip_spring', EngineCart.rails_options, ("-m #{EngineCart.template}" if EngineCart.template)].compact)
|
39
|
+
Rails::Generators::AppGenerator.start(['internal', '--skip_spring', *EngineCart.rails_options, ("-m #{EngineCart.template}" if EngineCart.template)].compact)
|
40
40
|
end
|
41
41
|
exit 0
|
42
42
|
end
|
data/lib/engine_cart/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: engine_cart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
113
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.
|
114
|
+
rubygems_version: 2.6.13
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Helper for testing Rails Engines sanely
|