rspec-scaffold 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +22 -0
- data/lib/rspec/scaffold.rb +9 -0
- data/lib/rspec/scaffold/generator.rb +2 -10
- data/lib/rspec/scaffold/version.rb +1 -1
- data/rspec-scaffold.gemspec +2 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51b15bd17f15c8ded617f732b63b29b839091124
|
4
|
+
data.tar.gz: 5cf8d3cd2aa8b584667c7ac49833682b378b1075
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04bbf347bcf64103ccfa680ee78514d1d455b9d698d51dec3272413513074a9aaf5204851e1cda559fc27404391134a5233fdf8a717d8a9e11e7fbd3e62c291d
|
7
|
+
data.tar.gz: 07f52b0f041b1ce612627ac453c35d18d538ba9bf20d6801aeea1a441d8ab1b95a4b206d19700a26f39fc401c6fab82006f737d96744b1d8bb17f66547d26ea2
|
data/LICENSE.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2015-2016 Ryan Buckley.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/rspec/scaffold.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "pathname"
|
2
2
|
require "delegate"
|
3
|
+
require "rspec"
|
3
4
|
require "ryan"
|
4
5
|
require "highline"
|
5
6
|
|
@@ -9,6 +10,14 @@ module RSpec
|
|
9
10
|
autoload :Runner, "rspec/scaffold/runner"
|
10
11
|
autoload :Generator, "rspec/scaffold/generator"
|
11
12
|
autoload :ConditionExhibit, "rspec/scaffold/condition_exhibit"
|
13
|
+
|
14
|
+
def self.helper_file
|
15
|
+
if defined?(::Rails) && RSpec::Core::Version::STRING.to_s >= '3'
|
16
|
+
'rails_helper'
|
17
|
+
else
|
18
|
+
'spec_helper'
|
19
|
+
end
|
20
|
+
end
|
12
21
|
end
|
13
22
|
end
|
14
23
|
|
@@ -13,13 +13,13 @@ module RSpec
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def const
|
16
|
-
@const ||= Kernel.const_get
|
16
|
+
@const ||= name.split('::').inject(Kernel) { |k, part| k.const_get part }
|
17
17
|
end
|
18
18
|
|
19
19
|
def perform
|
20
20
|
indent = (' ' * 2)
|
21
21
|
second_indent = indent * 2
|
22
|
-
lines = [%Q(require "#{helper_file}"), %Q(), %Q(describe #{const} do)]
|
22
|
+
lines = [%Q(require "#{Scaffold.helper_file}"), %Q(), %Q(describe #{const} do)]
|
23
23
|
if class?
|
24
24
|
initialization_args.each do |arg|
|
25
25
|
lines << %Q(#{indent}let(:#{arg.to_s.sub(/^[&*]/, '')}) {})
|
@@ -44,14 +44,6 @@ module RSpec
|
|
44
44
|
lines << %Q(end) << %Q()
|
45
45
|
lines
|
46
46
|
end
|
47
|
-
|
48
|
-
def helper_file
|
49
|
-
if defined?(::Rails)
|
50
|
-
'rails_helper'
|
51
|
-
else
|
52
|
-
'spec_helper'
|
53
|
-
end
|
54
|
-
end
|
55
47
|
end
|
56
48
|
end
|
57
49
|
end
|
data/rspec-scaffold.gemspec
CHANGED
@@ -14,9 +14,10 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = "https://github.com/ridiculous/rspec-scaffold"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
-
spec.bindir =
|
17
|
+
spec.bindir = 'exe'
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
20
|
+
spec.license = 'MIT'
|
20
21
|
|
21
22
|
spec.add_dependency 'highline', '~> 1.6'
|
22
23
|
spec.add_dependency 'ryan', '~> 1.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Buckley
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- ".ruby-version"
|
99
99
|
- ".travis.yml"
|
100
100
|
- Gemfile
|
101
|
+
- LICENSE.md
|
101
102
|
- README.md
|
102
103
|
- Rakefile
|
103
104
|
- bin/console
|
@@ -110,7 +111,8 @@ files:
|
|
110
111
|
- lib/rspec/scaffold/version.rb
|
111
112
|
- rspec-scaffold.gemspec
|
112
113
|
homepage: https://github.com/ridiculous/rspec-scaffold
|
113
|
-
licenses:
|
114
|
+
licenses:
|
115
|
+
- MIT
|
114
116
|
metadata: {}
|
115
117
|
post_install_message:
|
116
118
|
rdoc_options: []
|