radar-app 0.0.14 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +5 -0
- data/lib/radar/app/version.rb +1 -1
- data/radar-app.gemspec +1 -1
- data/spec/lib/radar/app/tasks/generate_spec.rb +63 -0
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bb47a7769afddee2a76b34f310b50115088c56c
|
4
|
+
data.tar.gz: a89c699d62227290c943b0166c130ea0e3667494
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 128982825a4bbc9a5dcd9153687bcf9c252086dc8be8a25ccb08d7c3364206ce0ecff591342cb11765812be34112bbd09f221b1637d317794c329b9b7b273386
|
7
|
+
data.tar.gz: a7f6d22d0ae1e8e8cc9182f0616ec2f3bb4f0fe9d0887321b06a3c5383033aaed499f50eeacbf3fe2437759740e6024c37f4034d9207ee551bef49606405ca58
|
data/Rakefile
CHANGED
data/lib/radar/app/version.rb
CHANGED
data/radar-app.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency "rspec", "~> 2.14"
|
25
25
|
|
26
26
|
spec.add_dependency "thor", "~> 0.19"
|
27
|
-
spec.add_dependency "radar-api", "~> 0.
|
27
|
+
spec.add_dependency "radar-api", "~> 0.2"
|
28
28
|
spec.add_dependency "thin", "1.6.2"
|
29
29
|
spec.add_dependency "connection_pool", "~> 2.0"
|
30
30
|
spec.add_dependency "activesupport", "~> 4.1"
|
@@ -0,0 +1,63 @@
|
|
1
|
+
$templates_path = File.expand_path('../../../../../templates', File.dirname(__FILE__))
|
2
|
+
require 'radar/app/runner'
|
3
|
+
require 'tmpdir'
|
4
|
+
|
5
|
+
def in_tmpdir
|
6
|
+
olddir = Dir.pwd
|
7
|
+
begin
|
8
|
+
Dir.mktmpdir do |tmpdir|
|
9
|
+
Dir.chdir(tmpdir)
|
10
|
+
yield tmpdir
|
11
|
+
end
|
12
|
+
ensure
|
13
|
+
Dir.chdir(olddir)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe Radar::App::Tasks::Generate do
|
18
|
+
around do |example|
|
19
|
+
in_tmpdir do
|
20
|
+
Dir.mkdir 'config'
|
21
|
+
File.open('config/app.rb', 'w') { |f| f.write '# ORIGINAL CONTENT' }
|
22
|
+
example.run
|
23
|
+
end
|
24
|
+
end
|
25
|
+
describe '#analyzer' do
|
26
|
+
it 'appends Analyzer registry to app config' do
|
27
|
+
Radar::App::Runner.start(%w{generate analyzer my-test})
|
28
|
+
expect(File.read('config/app.rb').lines).to include('Radar::App::AnalyzerController << MyTest')
|
29
|
+
end
|
30
|
+
context 'when parameter is given in camelcase' do
|
31
|
+
it 'creates the analyzer file with underscores' do
|
32
|
+
Radar::App::Runner.start(%w{generate analyzer myTest})
|
33
|
+
expect(File).to exist('analyzers/my_test.rb')
|
34
|
+
end
|
35
|
+
it 'writes the analyzer class with camelcase' do
|
36
|
+
Radar::App::Runner.start(%w{generate analyzer myTest})
|
37
|
+
expect(File.read('analyzers/my_test.rb')).to include('class MyTest')
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'when parameter is given in hyphen' do
|
42
|
+
it 'creates the analyzer file with underscores' do
|
43
|
+
Radar::App::Runner.start(%w{generate analyzer my-test})
|
44
|
+
expect(File).to exist('analyzers/my_test.rb')
|
45
|
+
end
|
46
|
+
it 'writes the analyzer class with camelcase' do
|
47
|
+
Radar::App::Runner.start(%w{generate analyzer my-test})
|
48
|
+
expect(File.read('analyzers/my_test.rb')).to include('class MyTest')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
context 'when parameter is given in capitalized' do
|
53
|
+
it 'creates the analyzer file decapitalized' do
|
54
|
+
Radar::App::Runner.start(%w{generate analyzer Test})
|
55
|
+
expect(File).to exist('analyzers/test.rb')
|
56
|
+
end
|
57
|
+
it 'writes the analyzer class with camelcase' do
|
58
|
+
Radar::App::Runner.start(%w{generate analyzer test})
|
59
|
+
expect(File.read('analyzers/test.rb')).to include('class Test')
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radar-app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonardo Mendonca
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-07-
|
12
|
+
date: 2014-07-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -87,14 +87,14 @@ dependencies:
|
|
87
87
|
requirements:
|
88
88
|
- - ~>
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: '0.
|
90
|
+
version: '0.2'
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - ~>
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '0.
|
97
|
+
version: '0.2'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: thin
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -183,6 +183,7 @@ files:
|
|
183
183
|
- lib/radar/app/tasks/server.rb
|
184
184
|
- lib/radar/app/version.rb
|
185
185
|
- radar-app.gemspec
|
186
|
+
- spec/lib/radar/app/tasks/generate_spec.rb
|
186
187
|
- templates/.webhook
|
187
188
|
- templates/Gemfile
|
188
189
|
- templates/Procfile
|
@@ -213,4 +214,5 @@ rubygems_version: 2.1.11
|
|
213
214
|
signing_key:
|
214
215
|
specification_version: 4
|
215
216
|
summary: radar-app generator
|
216
|
-
test_files:
|
217
|
+
test_files:
|
218
|
+
- spec/lib/radar/app/tasks/generate_spec.rb
|