lorj 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +19 -0
  3. data/Rakefile +48 -7
  4. data/build/build_with_proxy.sh +49 -0
  5. data/files/bundle.sh +19 -0
  6. data/files/proxy.sh +23 -0
  7. data/lib/compat/1.8/lorj_meta.rb +44 -0
  8. data/lib/compat/lorj_meta.rb +40 -0
  9. data/lib/core/compat/1.8/core_object_data.rb +36 -0
  10. data/lib/core/compat/1.8/lorj_data.rb +41 -0
  11. data/lib/core/compat/core_object_data.rb +33 -0
  12. data/lib/core/compat/lorj_data.rb +39 -0
  13. data/lib/core/core.rb +21 -0
  14. data/lib/core/core_internal.rb +3 -1
  15. data/lib/core/core_object_data.rb +14 -10
  16. data/lib/core/core_object_params.rb +1 -1
  17. data/lib/core/core_process.rb +20 -5
  18. data/lib/core/core_setup_encrypt.rb +4 -2
  19. data/lib/core/definition.rb +3 -1
  20. data/lib/core/lorj_basecontroller.rb +15 -2
  21. data/lib/core/lorj_baseprocess.rb +15 -1
  22. data/lib/core/lorj_data.rb +10 -18
  23. data/lib/core/lorj_keypath.rb +35 -14
  24. data/lib/lorj/compat.rb +99 -0
  25. data/lib/lorj/version.rb +2 -2
  26. data/lib/lorj.rb +1 -0
  27. data/lib/lorj_account.rb +1 -0
  28. data/lib/lorj_defaults.rb +1 -1
  29. data/lib/lorj_meta.rb +15 -16
  30. data/lorj.gemspec +12 -7
  31. data/spec/05_lorj_keypath_spec.rb +98 -57
  32. data/spec/06_lorj_object_data_spec.rb +15 -15
  33. data/spec/09_prc_spec.rb +3 -0
  34. data/spec/10_lorj_log_spec.rb +2 -3
  35. data/spec/11_lorj_defaults_spec.rb +2 -3
  36. data/spec/12_lorj_config_spec.rb +2 -1
  37. data/spec/13_lorj_account_spec.rb +2 -1
  38. data/spec/20_lorj_meta_spec.rb +14 -10
  39. data/spec/21_lorj_processes_spec.rb +7 -5
  40. data/spec/22_lorj_core_spec.rb +2 -4
  41. data/spec/spec_helper.rb +34 -0
  42. metadata +60 -19
@@ -15,13 +15,12 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
 
18
- # require 'byebug'
18
+ require 'rubygems'
19
+ require 'spec_helper'
19
20
 
20
21
  $LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib/core')
21
22
 
22
- require 'core_object_data'
23
- require 'subhash'
24
- require 'lorj_data'
23
+ require 'lorj'
25
24
 
26
25
  describe 'Lorj::ObjectData' do
27
26
  context 'initialize with internal false' do
@@ -44,17 +43,18 @@ describe 'Lorj::ObjectData' do
44
43
  @obj_data.<< h_hash
45
44
  expect(@obj_data[[:key3]]).to eq([:key31, :key32])
46
45
  end
47
- it 'Test method #to_s' do
48
- expect(@obj_data.to_s).to eq('-- Lorj::ObjectData --
49
- hdata:
50
- {}
51
- key1:
52
- value1
53
- key2:
54
- {:key22=>"value2"}
55
- key3:
56
- [:key31, :key32]
57
- ')
46
+ # In version Ruby 1.8, Yaml Hash load is unstable.
47
+ # Seems related to some context, where to_s provides all
48
+ # but the order printed out depends on some context that I do not understand
49
+ if RUBY_VERSION.match(/1\.8/)
50
+ puts "WARNING! Lorj::ObjectData.to_s won't work well on ruby 1.8 : "\
51
+ 'Hash is not keys order preserved.'
52
+ else
53
+ it 'Test method #to_s' do
54
+ ref = "-- Lorj::ObjectData --\nhdata:\n{}\nkey1:\nvalue1\nkey2:\n"\
55
+ "{:key22=>\"value2\"}\nkey3:\n[:key31, :key32]\n"
56
+ expect(@obj_data.to_s).to eq(ref)
57
+ end
58
58
  end
59
59
  end
60
60
  context 'initialize with internal true' do
data/spec/09_prc_spec.rb CHANGED
@@ -17,6 +17,9 @@
17
17
 
18
18
  # require 'byebug'
19
19
 
20
+ require 'rubygems'
21
+ require 'spec_helper'
22
+
20
23
  app_path = File.dirname(__FILE__)
21
24
  $LOAD_PATH << File.join(app_path, '..', 'lib')
22
25
 
@@ -15,9 +15,8 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
 
18
- # require 'rubygems'
19
- # require 'byebug'
20
- # require 'bundler/setup'
18
+ require 'rubygems'
19
+ require 'spec_helper'
21
20
 
22
21
  app_path = File.dirname(File.dirname(__FILE__))
23
22
 
@@ -15,9 +15,8 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
 
18
- # require 'rubygems'
19
- # require 'byebug'
20
- # require 'bundler/setup'
18
+ require 'rubygems'
19
+ require 'spec_helper'
21
20
 
22
21
  app_path = File.dirname(__FILE__)
23
22
 
@@ -15,7 +15,8 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
 
18
- # require 'byebug'
18
+ require 'rubygems'
19
+ require 'spec_helper'
19
20
 
20
21
  app_path = File.dirname(__FILE__)
21
22
 
@@ -15,7 +15,8 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
 
18
- # require 'byebug'
18
+ require 'rubygems'
19
+ require 'spec_helper'
19
20
 
20
21
  app_path = File.dirname(__FILE__)
21
22
 
@@ -15,9 +15,8 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
 
18
- # require 'rubygems'
19
- # require 'byebug'
20
- # require 'bundler/setup'
18
+ require 'rubygems'
19
+ require 'spec_helper'
21
20
 
22
21
  app_path = File.dirname(__FILE__)
23
22
 
@@ -58,12 +57,12 @@ YAMLDOC
58
57
  p_get(options)
59
58
  end
60
59
  end
61
-
60
+ stop
62
61
  @metadata = MetaAppConfigSpec.new YAML.load(data)
63
62
  end
64
63
 
65
64
  it 'sections returns [:section1, :section2].' do
66
- expect(@metadata.sections).to eq([:section1, :section2, :section3])
65
+ expect(@metadata.sections.sort).to eq([:section1, :section2, :section3])
67
66
  end
68
67
 
69
68
  it 'sections(:data1) returns [:section1].' do
@@ -71,15 +70,20 @@ YAMLDOC
71
70
  end
72
71
 
73
72
  it 'sections(:data2) returns [:section1, :section2].' do
74
- expect(@metadata.sections(:data2)).to eq([:section1, :section2])
73
+ expect(@metadata.sections(:data2).sort).to eq([:section1, :section2])
75
74
  end
76
75
 
77
- it 'datas returns [:data1, :data2].' do
76
+ it 'datas returns [:data1, :data2, :data3].' do
78
77
  expect(@metadata.datas).to eq([:data1, :data2, :data3])
79
78
  end
80
79
 
81
- it 'first_section(:data2) returns [:section1, :data2]' do
82
- expect(@metadata.first_section(:data2)).to eq([:section1, :data2])
80
+ if /1\.8/ =~ RUBY_VERSION
81
+ puts "WARNING! first_section(:data2) won't work well on ruby 1.8 : "\
82
+ 'Hash is not keys order preserved.'
83
+ else
84
+ it 'first_section(:data2) returns [:section1, :data2]' do
85
+ expect(@metadata.first_section(:data2)).to eq([:section1, :data2])
86
+ end
83
87
  end
84
88
 
85
89
  it 'first_section("section2#data2") returns [:section2, :data2]' do
@@ -156,7 +160,7 @@ YAMLDOC
156
160
  expect(@metadata[:sections, :section2, :data2, :option2]).to eq('value3')
157
161
  expect(@metadata.define_controller_data(:section2,
158
162
  :data2, data)).to eq(data)
159
- expect(@metadata.sections(:data2)).to eq([:section1, :section2])
163
+ expect(@metadata.sections(:data2).sort).to eq([:section1, :section2])
160
164
  expect(@metadata[:sections, :section2, :data2, :option2]).to eq(:value4)
161
165
  end
162
166
 
@@ -15,10 +15,8 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
 
18
- # require 'rubygems'
19
- # require 'byebug'
20
- # require 'debugger'
21
- # require 'bundler/setup'
18
+ require 'rubygems'
19
+ require 'spec_helper'
22
20
 
23
21
  app_path = File.dirname(__FILE__)
24
22
 
@@ -140,7 +138,11 @@ describe 'Lorj::Process,' do
140
138
 
141
139
  it 'all kept module processes in Lorj.processes not duplicated.' do
142
140
  expect(Lorj.processes.length).to eq(2)
143
- expect(Lorj.processes.keys).to eq(%w(mock mock2))
141
+ if RUBY_VERSION.match(/1\.8/)
142
+ expect(Lorj.processes.keys.sort).to eq(%w(mock mock2))
143
+ else
144
+ expect(Lorj.processes.keys).to eq(%w(mock mock2))
145
+ end
144
146
  end
145
147
  end
146
148
  end
@@ -15,10 +15,8 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
 
18
- # require 'rubygems'
19
- # require 'byebug'
20
- # require 'debugger'
21
- # require 'bundler/setup'
18
+ require 'rubygems'
19
+ require 'spec_helper'
22
20
 
23
21
  app_path = File.dirname(__FILE__)
24
22
 
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: UTF-8
3
+
4
+ # (c) Copyright 2014 Hewlett-Packard Development Company, L.P.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ require 'rubygems'
19
+ if ENV['RSPEC_DEBUG'] == 'true'
20
+ if /1\.8/ =~ RUBY_VERSION
21
+ require 'ruby-debug'
22
+ Debugger.start
23
+ alias stop debugger # rubocop: disable Style/Alias
24
+ elsif /1\.9/ =~ RUBY_VERSION
25
+ require 'debugger'
26
+ alias stop debugger # rubocop: disable Style/Alias
27
+ else
28
+ require 'byebug'
29
+ alias stop byebug # rubocop: disable Style/Alias
30
+ end
31
+ else
32
+ def stop
33
+ end
34
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lorj
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - forj team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-20 00:00:00.000000000 Z
11
+ date: 2015-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -53,21 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.1.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: rubocop
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: 0.29.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.29.0
69
- - !ruby/object:Gem::Dependency
70
- name: byebug
56
+ name: rdoc
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
59
  - - '>='
@@ -86,14 +72,14 @@ dependencies:
86
72
  requirements:
87
73
  - - ~>
88
74
  - !ruby/object:Gem::Version
89
- version: 0.1.3
75
+ version: 0.1.4
90
76
  type: :runtime
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - ~>
95
81
  - !ruby/object:Gem::Version
96
- version: 0.1.3
82
+ version: 0.1.4
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: highline
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +122,48 @@ dependencies:
136
122
  - - '='
137
123
  - !ruby/object:Gem::Version
138
124
  version: 1.3.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: json
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: byebug
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ~>
158
+ - !ruby/object:Gem::Version
159
+ version: 0.30.0
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ~>
165
+ - !ruby/object:Gem::Version
166
+ version: 0.30.0
139
167
  description: |2
140
168
  Framework to create/maintain uniform process, against any kind of controller.
141
169
  This library is used by forj to become cloud agnostic.
@@ -150,11 +178,13 @@ files:
150
178
  - .gitreview
151
179
  - .rspec
152
180
  - .rubocop.yml
181
+ - Dockerfile
153
182
  - Gemfile
154
183
  - LICENSE.txt
155
184
  - README.md
156
185
  - Rakefile
157
186
  - bin/cloud_test.rb
187
+ - build/build_with_proxy.sh
158
188
  - example/students_1/process/students.rb
159
189
  - example/students_1/student_v1.md
160
190
  - example/students_1/students.rb
@@ -182,7 +212,15 @@ files:
182
212
  - example/students_5/students.rb
183
213
  - example/yaml_students/students.rb
184
214
  - example/yaml_students/yaml_students.rb
215
+ - files/bundle.sh
216
+ - files/proxy.sh
217
+ - lib/compat/1.8/lorj_meta.rb
218
+ - lib/compat/lorj_meta.rb
185
219
  - lib/concept.md
220
+ - lib/core/compat/1.8/core_object_data.rb
221
+ - lib/core/compat/1.8/lorj_data.rb
222
+ - lib/core/compat/core_object_data.rb
223
+ - lib/core/compat/lorj_data.rb
186
224
  - lib/core/core.rb
187
225
  - lib/core/core_controller.rb
188
226
  - lib/core/core_internal.rb
@@ -209,6 +247,7 @@ files:
209
247
  - lib/img/forj-lib-concept.png
210
248
  - lib/logging.rb
211
249
  - lib/lorj.rb
250
+ - lib/lorj/compat.rb
212
251
  - lib/lorj/version.rb
213
252
  - lib/lorj_account.rb
214
253
  - lib/lorj_config.rb
@@ -239,6 +278,7 @@ files:
239
278
  - spec/20_lorj_meta_spec.rb
240
279
  - spec/21_lorj_processes_spec.rb
241
280
  - spec/22_lorj_core_spec.rb
281
+ - spec/spec_helper.rb
242
282
  homepage: https://github.com/forj-oss/lorj
243
283
  licenses:
244
284
  - Apache License, Version 2.0.
@@ -276,3 +316,4 @@ test_files:
276
316
  - spec/20_lorj_meta_spec.rb
277
317
  - spec/21_lorj_processes_spec.rb
278
318
  - spec/22_lorj_core_spec.rb
319
+ - spec/spec_helper.rb