radar-app 0.1.1 → 0.1.2

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: a8077f6b19cc433e1198234acecc5530f2924cad
4
- data.tar.gz: db68706cf9312353688b89776c8b66ec8431ad02
3
+ metadata.gz: 3fb6b20d6df8f4cc3b56d91408d22aae3e84128b
4
+ data.tar.gz: 33a551fca948d6c5892308c9aa314a06baa632e2
5
5
  SHA512:
6
- metadata.gz: 84f92d0b169a92324130d3849ee11ed697c1fc63fc708def3f3d1d1bea4ae2d985d87034a2dfedf1b5e9996e39b8345d9f65573c485e8f3b0943c3981c7cc518
7
- data.tar.gz: 00d99b8f78970d34a40a0b5dc37ec827fd1dd75f296a311588605e7f5ccc6258315fe1a082ad10c9e8efe13a72e4bac45d5c0f4363a9bcd121f67e2c1d26d269
6
+ metadata.gz: f2845a1c8fb8eaf8741ecdcbff2c7e2dbc83f648697d4091f0940ec2acca0f3240698fe8490176b3061a8bba6bf591219166fc2cddab3239c257e11e48ba0f93
7
+ data.tar.gz: f1313c072a94e6b88328503cfbd6729026801de924c0bced71e9f6015d09c195885b090e7f075266378dec9a9926621004a2de231c6e8e58bffbc282d9c1a660
data/lib/radar/app.rb CHANGED
@@ -6,6 +6,7 @@ require 'radar/app/controller'
6
6
  require 'radar/app/analyzer_controller'
7
7
  require 'radar/app/server'
8
8
  require 'radar/app/bootstrap'
9
+ require 'radar/app/analyzer'
9
10
 
10
11
  require 'radar-api'
11
12
  require 'connection_pool'
@@ -0,0 +1,15 @@
1
+ module Radar
2
+ module App
3
+ module Analyzer
4
+ def dump
5
+ Marshal.dump(instance_variables.map { |v| [ v, instance_variable_get(v) ] })
6
+ end
7
+
8
+ def resume(data)
9
+ Marshal.load(data).each do |name, value|
10
+ instance_variable_set(name, value)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  module Radar
2
2
  module App
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -0,0 +1,29 @@
1
+ require 'radar/app/analyzer'
2
+
3
+ RSpec.describe Radar::App::Analyzer do
4
+ describe '#dump and #resume' do
5
+ let(:old_analyzer) { analyzer_class.new }
6
+ let(:new_analyzer) { analyzer_class.new }
7
+ let(:analyzer_class) do
8
+ Class.new do
9
+
10
+ include Radar::App::Analyzer
11
+
12
+ def define_vars
13
+ @first_var = '1st'
14
+ @second_var = 2
15
+ end
16
+ end
17
+ end
18
+ it 'dumps and restores all instance variables' do
19
+ old_analyzer.define_vars
20
+ new_analyzer.resume(old_analyzer.dump)
21
+ expect(new_analyzer.instance_variables).to eq [:@first_var, :@second_var]
22
+ end
23
+ it 'dumps and restores instance variable values' do
24
+ old_analyzer.define_vars
25
+ new_analyzer.resume(old_analyzer.dump)
26
+ expect(new_analyzer.instance_variable_get(:@first_var)).to eq '1st'
27
+ end
28
+ end
29
+ 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.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonardo Mendonca
@@ -9,20 +9,20 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-08-21 00:00:00.000000000 Z
12
+ date: 2016-09-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: '1.5'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ~>
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '1.5'
28
28
  - !ruby/object:Gem::Dependency
@@ -57,42 +57,42 @@ dependencies:
57
57
  name: rspec
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ~>
60
+ - - "~>"
61
61
  - !ruby/object:Gem::Version
62
62
  version: '2.14'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ~>
67
+ - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: '2.14'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: thor
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ~>
74
+ - - "~>"
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0.19'
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ~>
81
+ - - "~>"
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0.19'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: radar-api
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ~>
88
+ - - "~>"
89
89
  - !ruby/object:Gem::Version
90
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
97
  version: '0.2'
98
98
  - !ruby/object:Gem::Dependency
@@ -113,42 +113,42 @@ dependencies:
113
113
  name: connection_pool
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - ~>
116
+ - - "~>"
117
117
  - !ruby/object:Gem::Version
118
118
  version: '2.0'
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - ~>
123
+ - - "~>"
124
124
  - !ruby/object:Gem::Version
125
125
  version: '2.0'
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: activesupport
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - ~>
130
+ - - "~>"
131
131
  - !ruby/object:Gem::Version
132
132
  version: '4.1'
133
133
  type: :runtime
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ~>
137
+ - - "~>"
138
138
  - !ruby/object:Gem::Version
139
139
  version: '4.1'
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: thrift_client
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - ~>
144
+ - - "~>"
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0.9'
147
147
  type: :runtime
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
- - - ~>
151
+ - - "~>"
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0.9'
154
154
  description: generates and run a radar-app.
@@ -159,8 +159,8 @@ executables:
159
159
  extensions: []
160
160
  extra_rdoc_files: []
161
161
  files:
162
- - .gitignore
163
- - .rspec
162
+ - ".gitignore"
163
+ - ".rspec"
164
164
  - Gemfile
165
165
  - Guardfile
166
166
  - LICENSE.txt
@@ -169,6 +169,7 @@ files:
169
169
  - bin/radar-app
170
170
  - lib/radar-app.rb
171
171
  - lib/radar/app.rb
172
+ - lib/radar/app/analyzer.rb
172
173
  - lib/radar/app/analyzer_controller.rb
173
174
  - lib/radar/app/bootstrap.rb
174
175
  - lib/radar/app/controller.rb
@@ -188,6 +189,7 @@ files:
188
189
  - spec/example.thrift
189
190
  - spec/gen-rb/example_constants.rb
190
191
  - spec/gen-rb/example_types.rb
192
+ - spec/lib/radar/app/analyzer_spec.rb
191
193
  - spec/lib/radar/app/tasks/generate_spec.rb
192
194
  - spec/lib/thrift/builder_spec.rb
193
195
  - templates/.webhook
@@ -206,17 +208,17 @@ require_paths:
206
208
  - lib
207
209
  required_ruby_version: !ruby/object:Gem::Requirement
208
210
  requirements:
209
- - - '>='
211
+ - - ">="
210
212
  - !ruby/object:Gem::Version
211
213
  version: '0'
212
214
  required_rubygems_version: !ruby/object:Gem::Requirement
213
215
  requirements:
214
- - - '>='
216
+ - - ">="
215
217
  - !ruby/object:Gem::Version
216
218
  version: '0'
217
219
  requirements: []
218
220
  rubyforge_project:
219
- rubygems_version: 2.2.2
221
+ rubygems_version: 2.2.5
220
222
  signing_key:
221
223
  specification_version: 4
222
224
  summary: radar-app generator
@@ -224,6 +226,6 @@ test_files:
224
226
  - spec/example.thrift
225
227
  - spec/gen-rb/example_constants.rb
226
228
  - spec/gen-rb/example_types.rb
229
+ - spec/lib/radar/app/analyzer_spec.rb
227
230
  - spec/lib/radar/app/tasks/generate_spec.rb
228
231
  - spec/lib/thrift/builder_spec.rb
229
- has_rdoc: