chemlab 0.6.0 → 0.7.3

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
  SHA256:
3
- metadata.gz: 915c01df3e022bd6da7158493e4da0cab8df087854f696ee048ab4ca6ed32d50
4
- data.tar.gz: ff042d7a35caca43a932a3802ed765ba988b9f983f8a6ffe11905564876c674a
3
+ metadata.gz: 16b138dd1ea82aa663333b42dcdaa00efbba338a929d7f2fb1789aa864094747
4
+ data.tar.gz: b35c1771c8ceb822ed8e948b6e1d5c40b9a89b39bfede2f9c36348ca20bbcc2e
5
5
  SHA512:
6
- metadata.gz: 48967c413bc7c0f0650439c7c3d11aa3ef46cb5b0235d40bc80de82ae0b273838e4f35b8c3f2a4f8a5335307904f6447ffaec16607ce8f59cd31881b01461bb9
7
- data.tar.gz: eb7b262ca50286d81bc86658e6e4f422ce19c9988e69cb6cbf9d52276d66adf0fb245575310b3ec6308959f59e0c7a9441a994857e24d0cb4a8431fae93b1ea0
6
+ metadata.gz: 417cd502e6da022cb8e6e4fbacc061bd6191c363fce8c7c6a47d910d9d9b315bde7de3fa99802455a8fbb73fe2017a5bf11164be1b597a0bf232322a4919f032
7
+ data.tar.gz: 5a4272aaf6b7d431660cb595432260e59bc3b83d1078acdbb08039d8c96441f748f8fad1716ab3f3b052790c6e711419362ae4bc7eedd499ace4cd53defe3b6c
data/Rakefile CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'bundler/gem_tasks' # load bundler gem tasks such as `build`, `release` to help maintain Chemlab Libraries
4
+
3
5
  # enable metadata. this is required for --help
4
6
  Rake::TaskManager.record_task_metadata = true
5
7
 
@@ -16,7 +16,7 @@ module Chemlab
16
16
  raise %(Cannot create new library `#{library_name}` as the directory "#{library_name}" already exists)
17
17
  end
18
18
 
19
- require 'active_support/core_ext/string/inflections'
19
+ require 'chemlab/core_ext/string/inflections'
20
20
 
21
21
  @library = {
22
22
  name: library_name,
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ <% generation_message = '# This is a stub, used for indexing. The method is dynamically generated' %>
3
4
  <% modules = library.to_s.split('::') %>
4
5
  <% root = (' ' * modules.size) %>
5
6
  <% modules.each_with_index do |mod, indent| %>
@@ -12,7 +13,7 @@
12
13
  <%= root %># Clicks +<%= element[:name] %>+
13
14
  <%= root %>def <%= element[:name] %>
14
15
 
15
- <%= root %> # This is a stub, used for indexing
16
+ <%= root %> <%= generation_message %>.
16
17
  <%= root %>end
17
18
 
18
19
  <% else %>
@@ -20,7 +21,7 @@
20
21
  <%= root %># @return [String] The text content or value of +<%= element[:name] %>+
21
22
  <%= root %>def <%= element[:name] %>
22
23
 
23
- <%= root %> # This is a stub, used for indexing
24
+ <%= root %> <%= generation_message %>.
24
25
  <%= root %>end
25
26
 
26
27
  <% end %>
@@ -34,7 +35,7 @@
34
35
  <%= root %># end
35
36
  <%= root %># @param value [String] The value to set.
36
37
  <%= root %>def <%= element[:name] %>=(value)
37
- <%= root %> # This is a stub, used for indexing
38
+ <%= root %> <%= generation_message %>.
38
39
  <%= root %>end
39
40
  <% end %>
40
41
 
@@ -44,7 +45,7 @@
44
45
  <%= root %># end
45
46
  <%= root %># @return [Watir::<%= element[:type].to_s.classify %>] The raw +<%= element[:type].to_s.classify %>+ element
46
47
  <%= root %>def <%= element[:name] %>_element
47
- <%= root %> # This is a stub, used for indexing
48
+ <%= root %> <%= generation_message %>.
48
49
  <%= root %>end
49
50
 
50
51
  <%= root %># @example
@@ -54,7 +55,7 @@
54
55
  <%= root %># end
55
56
  <%= root %># @return [Boolean] true if the +<%= element[:name] %>+ element is present on the page
56
57
  <%= root %>def <%= element[:name] %>?
57
- <%= root %> # This is a stub, used for indexing
58
+ <%= root %> <%= generation_message %>.
58
59
  <%= root %>end
59
60
 
60
61
  <% end %>
@@ -53,7 +53,7 @@ module Chemlab
53
53
 
54
54
  library = Stubber.libraries.last # last appended library is this Page Library
55
55
 
56
- require 'active_support/core_ext/string/inflections'
56
+ require 'chemlab/core_ext/string/inflections'
57
57
 
58
58
  stub_path = @path.gsub(@path[@path.rindex('.')..], '.stub.rb')
59
59
  File.open(stub_path, 'w') do |stub|
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Start monkey patch of Object::String
4
+ class String
5
+ # Classify a string
6
+ # @example
7
+ # 'test_class'.classify #=> TestClass
8
+ # @example
9
+ # 'testclass'.classify #=> Testclass
10
+ def classify
11
+ split('_').map(&:capitalize).join
12
+ end
13
+
14
+ # Underscore a multi-worded string
15
+ # @example
16
+ # 'TestClass'.underscore #=> 'test_class'
17
+ # @example
18
+ # 'Class'.underscore #=> 'class'
19
+ def underscore
20
+ chars.each_with_object(+'') do |c, str|
21
+ str << '_' if c.match?(/[A-Z]/) && !str.size.zero?
22
+ str << c.downcase
23
+ end
24
+ end
25
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chemlab
4
- VERSION = '0.6.0'
4
+ VERSION = '0.7.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chemlab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab Quality
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-23 00:00:00.000000000 Z
11
+ date: 2021-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -122,90 +122,94 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 0.9.26
125
- - !ruby/object:Gem::Dependency
126
- name: activesupport-inflector
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 0.1.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.1.0
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: colorize
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
129
  - - "~>"
144
130
  - !ruby/object:Gem::Version
145
- version: 0.8.1
131
+ version: '0.8'
146
132
  type: :runtime
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
136
  - - "~>"
151
137
  - !ruby/object:Gem::Version
152
- version: 0.8.1
138
+ version: '0.8'
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: i18n
155
141
  requirement: !ruby/object:Gem::Requirement
156
142
  requirements:
157
143
  - - "~>"
158
144
  - !ruby/object:Gem::Version
159
- version: 1.8.10
145
+ version: '1.8'
160
146
  type: :runtime
161
147
  prerelease: false
162
148
  version_requirements: !ruby/object:Gem::Requirement
163
149
  requirements:
164
150
  - - "~>"
165
151
  - !ruby/object:Gem::Version
166
- version: 1.8.10
152
+ version: '1.8'
167
153
  - !ruby/object:Gem::Dependency
168
154
  name: rake
169
155
  requirement: !ruby/object:Gem::Requirement
170
156
  requirements:
171
- - - "~>"
157
+ - - ">="
172
158
  - !ruby/object:Gem::Version
173
- version: 13.0.3
159
+ version: '12'
160
+ - - "<"
161
+ - !ruby/object:Gem::Version
162
+ version: '14'
174
163
  type: :runtime
175
164
  prerelease: false
176
165
  version_requirements: !ruby/object:Gem::Requirement
177
166
  requirements:
178
- - - "~>"
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: '12'
170
+ - - "<"
179
171
  - !ruby/object:Gem::Version
180
- version: 13.0.3
172
+ version: '14'
181
173
  - !ruby/object:Gem::Dependency
182
174
  name: selenium-webdriver
183
175
  requirement: !ruby/object:Gem::Requirement
184
176
  requirements:
185
- - - "~>"
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '3'
180
+ - - "<"
186
181
  - !ruby/object:Gem::Version
187
- version: '3.12'
182
+ version: '5'
188
183
  type: :runtime
189
184
  prerelease: false
190
185
  version_requirements: !ruby/object:Gem::Requirement
191
186
  requirements:
192
- - - "~>"
187
+ - - ">="
193
188
  - !ruby/object:Gem::Version
194
- version: '3.12'
189
+ version: '3'
190
+ - - "<"
191
+ - !ruby/object:Gem::Version
192
+ version: '5'
195
193
  - !ruby/object:Gem::Dependency
196
194
  name: watir
197
195
  requirement: !ruby/object:Gem::Requirement
198
196
  requirements:
199
- - - "~>"
197
+ - - ">="
198
+ - !ruby/object:Gem::Version
199
+ version: '6'
200
+ - - "<"
200
201
  - !ruby/object:Gem::Version
201
- version: '6.17'
202
+ version: '8'
202
203
  type: :runtime
203
204
  prerelease: false
204
205
  version_requirements: !ruby/object:Gem::Requirement
205
206
  requirements:
206
- - - "~>"
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ version: '6'
210
+ - - "<"
207
211
  - !ruby/object:Gem::Version
208
- version: '6.17'
212
+ version: '8'
209
213
  description:
210
214
  email:
211
215
  - quality@gitlab.com
@@ -235,6 +239,7 @@ files:
235
239
  - lib/chemlab/cli/stubber.rb
236
240
  - lib/chemlab/component.rb
237
241
  - lib/chemlab/configuration.rb
242
+ - lib/chemlab/core_ext/string/inflections.rb
238
243
  - lib/chemlab/element.rb
239
244
  - lib/chemlab/page.rb
240
245
  - lib/chemlab/runtime/browser.rb
@@ -258,7 +263,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
258
263
  requirements:
259
264
  - - ">="
260
265
  - !ruby/object:Gem::Version
261
- version: 2.7.2
266
+ version: '2.5'
262
267
  required_rubygems_version: !ruby/object:Gem::Requirement
263
268
  requirements:
264
269
  - - ">="