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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7aee1be7410c0aecfc2167c96e29eba83f136bc5
4
- data.tar.gz: 910108e4722f0a921f83e6c15dadd4d245a70d49
3
+ metadata.gz: 2bb47a7769afddee2a76b34f310b50115088c56c
4
+ data.tar.gz: a89c699d62227290c943b0166c130ea0e3667494
5
5
  SHA512:
6
- metadata.gz: c21b5f4174fe0464b2a07d0a27e1b6f893edd1466455cb3043deec6aae738fa3bd49b91d4e4864355878025adc844127b582d79cc8bead63124a76a8c0753026
7
- data.tar.gz: 15c2476572924c43a62f398e837443261da617abe74e6d554ffb95cd9a4623cb5b837f5221d94015ed1657866de7b71a8db16e00e75783914e1680a2df2aebe6
6
+ metadata.gz: 128982825a4bbc9a5dcd9153687bcf9c252086dc8be8a25ccb08d7c3364206ce0ecff591342cb11765812be34112bbd09f221b1637d317794c329b9b7b273386
7
+ data.tar.gz: a7f6d22d0ae1e8e8cc9182f0616ec2f3bb4f0fe9d0887321b06a3c5383033aaed499f50eeacbf3fe2437759740e6024c37f4034d9207ee551bef49606405ca58
data/Rakefile CHANGED
@@ -1 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -1,5 +1,5 @@
1
1
  module Radar
2
2
  module App
3
- VERSION = "0.0.14"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
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.1"
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.14
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-11 00:00:00.000000000 Z
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.1'
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.1'
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