spring_engine 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +31 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/rails +17 -0
- data/bin/rake +8 -0
- data/bin/rspec +8 -0
- data/bin/setup +8 -0
- data/bin/spring_engine +4 -0
- data/lib/spring_engine/configure.rb +70 -0
- data/lib/spring_engine/version.rb +3 -0
- data/lib/spring_engine.rb +5 -0
- data/spring_engine.gemspec +30 -0
- metadata +146 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 176617d5347468af092735d2bf0a9b95d21f6410
|
4
|
+
data.tar.gz: fddf530b24f0db4d2078a273c25477a62e772ed1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f41f4e1424abe9b13eae3548eba67ec9ad941f61fce6c6a9522a0983e8a46909f61e26f383508afc1db350a86799fe80c376c206571d8c02f8b7ab4e871f1dae
|
7
|
+
data.tar.gz: f62dc16cec764c3329534710d148ccc52c1874724df841fddbd984f320e72893626e8d085b9323636513de954cc0823acb1bb1aebe3087a1f233858b050d628d
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Ryan Murphy
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# SpringEngine
|
2
|
+
|
3
|
+
SpringEngine is a configuration utility for setting up Spring on a Rails engine.
|
4
|
+
## Installation
|
5
|
+
|
6
|
+
Add `spring_engine`, `spring`, and any other spring command gems to your Rails engine Gemfile and bundle
|
7
|
+
|
8
|
+
```ruby
|
9
|
+
gem 'spring'
|
10
|
+
gem 'spring_engine'
|
11
|
+
```
|
12
|
+
$ bundle
|
13
|
+
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
First ensure your engine has a test app. You may create one manually or use a generator such as EngineCart.
|
18
|
+
|
19
|
+
Now in the root directory of your Rails engine, execute the following with the path to your test app:
|
20
|
+
```
|
21
|
+
$ bundle exec spring_engine *path_to_dummy_folder*
|
22
|
+
```
|
23
|
+
SpringEngine runs `spring binstub --all` for you. You are now ready to use Spring.
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/murjax/spring_engine.
|
28
|
+
|
29
|
+
## License
|
30
|
+
|
31
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "spring_engine"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/rails
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run 'rails' with Rails gems
|
3
|
+
# installed from the root of your application.
|
4
|
+
begin
|
5
|
+
load File.expand_path('../spring', __FILE__)
|
6
|
+
rescue LoadError => e
|
7
|
+
raise unless e.message.include?('spring')
|
8
|
+
end
|
9
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
10
|
+
ENGINE_PATH = File.expand_path('../../lib/spring_engine/engine', __FILE__)
|
11
|
+
|
12
|
+
# Set up gems listed in the Gemfile.
|
13
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
14
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
15
|
+
|
16
|
+
require 'rails/all'
|
17
|
+
require 'rails/engine/commands'
|
data/bin/rake
ADDED
data/bin/rspec
ADDED
data/bin/setup
ADDED
data/bin/spring_engine
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
module SpringEngine
|
2
|
+
class Configure
|
3
|
+
|
4
|
+
def initialize(path_to_dummy)
|
5
|
+
@path = path_to_dummy.first
|
6
|
+
end
|
7
|
+
|
8
|
+
def configure_spring_for_engine
|
9
|
+
write_spring_config
|
10
|
+
exec_spring_binstub
|
11
|
+
copy_dummy_bin
|
12
|
+
write_bin_rails
|
13
|
+
end
|
14
|
+
|
15
|
+
def exec_spring_binstub
|
16
|
+
`bundle exec spring binstub --all`
|
17
|
+
end
|
18
|
+
|
19
|
+
def copy_dummy_bin
|
20
|
+
FileUtils.mkdir("bin") unless File.exists?("bin")
|
21
|
+
copy_standard_commands
|
22
|
+
copy_optional_commands
|
23
|
+
end
|
24
|
+
|
25
|
+
def copy_standard_commands
|
26
|
+
standard_commands = ['rake', 'spring']
|
27
|
+
standard_commands.each do |command|
|
28
|
+
`cp -r #{@path}/bin/#{command} bin/#{command}`
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def copy_optional_commands
|
33
|
+
optional_commands = ['rspec', 'cucumber', 'spinach', 'testunit', 'teaspoon', 'm', 'rubocop']
|
34
|
+
optional_commands.each do |command|
|
35
|
+
`cp -r #{@path}/bin/rspec bin/#{command}` if File.exists?("#{@path}/bin/#{command}")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def write_spring_config
|
40
|
+
FileUtils.mkdir("config") unless File.exists?("config")
|
41
|
+
|
42
|
+
File.open("config/spring.rb", "w") do |file|
|
43
|
+
file.puts "Spring.application_root='#{@path}'"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def write_bin_rails
|
48
|
+
File.open("bin/rails", "w") do |file|
|
49
|
+
file.puts "#!/usr/bin/env ruby
|
50
|
+
# This command will automatically be run when you run 'rails' with Rails gems
|
51
|
+
# installed from the root of your application.
|
52
|
+
begin
|
53
|
+
load File.expand_path('../spring', __FILE__)
|
54
|
+
rescue LoadError => e
|
55
|
+
raise unless e.message.include?('spring')
|
56
|
+
end
|
57
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
58
|
+
ENGINE_PATH = File.expand_path('../../lib/#{File.basename(Dir.getwd)}/engine', __FILE__)
|
59
|
+
|
60
|
+
# Set up gems listed in the Gemfile.
|
61
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
62
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
63
|
+
|
64
|
+
require 'rails/all'
|
65
|
+
require 'rails/engine/commands'"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "spring_engine/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "spring_engine"
|
8
|
+
spec.version = SpringEngine::VERSION
|
9
|
+
spec.authors = ["Ryan Murphy"]
|
10
|
+
spec.email = ["murjax@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Spring configuration gem for Rails engines.}
|
13
|
+
spec.description = %q{spring_engine is a configuration utility for setting up Spring on a Rails engine.}
|
14
|
+
spec.homepage = "https://github.com/murjax/spring_engine"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
27
|
+
spec.add_development_dependency "spring"
|
28
|
+
spec.add_development_dependency "spring-commands-rspec"
|
29
|
+
spec.add_development_dependency "pry"
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: spring_engine
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ryan Murphy
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-06-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.15'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.15'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: spring
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: spring-commands-rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: spring_engine is a configuration utility for setting up Spring on a Rails
|
98
|
+
engine.
|
99
|
+
email:
|
100
|
+
- murjax@gmail.com
|
101
|
+
executables: []
|
102
|
+
extensions: []
|
103
|
+
extra_rdoc_files: []
|
104
|
+
files:
|
105
|
+
- ".gitignore"
|
106
|
+
- ".rspec"
|
107
|
+
- ".travis.yml"
|
108
|
+
- Gemfile
|
109
|
+
- LICENSE.txt
|
110
|
+
- README.md
|
111
|
+
- Rakefile
|
112
|
+
- bin/console
|
113
|
+
- bin/rails
|
114
|
+
- bin/rake
|
115
|
+
- bin/rspec
|
116
|
+
- bin/setup
|
117
|
+
- bin/spring_engine
|
118
|
+
- lib/spring_engine.rb
|
119
|
+
- lib/spring_engine/configure.rb
|
120
|
+
- lib/spring_engine/version.rb
|
121
|
+
- spring_engine.gemspec
|
122
|
+
homepage: https://github.com/murjax/spring_engine
|
123
|
+
licenses:
|
124
|
+
- MIT
|
125
|
+
metadata: {}
|
126
|
+
post_install_message:
|
127
|
+
rdoc_options: []
|
128
|
+
require_paths:
|
129
|
+
- lib
|
130
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
+
requirements:
|
132
|
+
- - ">="
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
requirements: []
|
141
|
+
rubyforge_project:
|
142
|
+
rubygems_version: 2.6.11
|
143
|
+
signing_key:
|
144
|
+
specification_version: 4
|
145
|
+
summary: Spring configuration gem for Rails engines.
|
146
|
+
test_files: []
|