chemlab 0.7.1 → 0.7.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
  SHA256:
3
- metadata.gz: b5adc75f1131d78970aa177e504bd9054b1bf07aab8c7bb2cbf0056fb81fa889
4
- data.tar.gz: e1089e0141e142684cb6eac2dfac48a4383cd043d32902362f7c26b45c8b52a3
3
+ metadata.gz: d84958e53d93ed46c4a4f93d1c236ae724b7f328ed010b0432ceef6c1ba23d21
4
+ data.tar.gz: 78df858369ff4a789f328bfb75f6ef550a594456b2ab57b0dcf44dd294c2772e
5
5
  SHA512:
6
- metadata.gz: bdcad6b56b68d707a83cf9d932eb290d272e48b2c67c24ee0c5f2e4fe2e158b3bff80268652780d344da0e4b7f922634549b9a02601a19adcc0c73c1019913ab
7
- data.tar.gz: f0856ad93ae0b5f18f9b0590f1ba897418d9e0ba2557da225fcea29f448c868d528eb4e04b5d09753a3f7572a859711aaf1ad59bc3344665637703ebf7b3fd78
6
+ metadata.gz: 2da525ce9135405cf917410515943d1542db46c4270f25ec5bbaa910b93f1d7a4fac83c8defa51ec9513e826c681bb22db2bd8721fe4561584d5588ae6019a02
7
+ data.tar.gz: 99086cec60d34d42b25ea7415fdf464259e4742085d77e438fe9553692a176e4d5ad819f466c25e3c07841adeb4d17f1cff2a1f78d23f72632ab5dc1c395207f
@@ -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,
@@ -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.7.1'
4
+ VERSION = '0.7.2'
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.7.1
4
+ version: 0.7.2
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-07-07 00:00:00.000000000 Z
11
+ date: 2021-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -122,20 +122,6 @@ 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'
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'
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: colorize
141
127
  requirement: !ruby/object:Gem::Requirement
@@ -253,6 +239,7 @@ files:
253
239
  - lib/chemlab/cli/stubber.rb
254
240
  - lib/chemlab/component.rb
255
241
  - lib/chemlab/configuration.rb
242
+ - lib/chemlab/core_ext/string/inflections.rb
256
243
  - lib/chemlab/element.rb
257
244
  - lib/chemlab/page.rb
258
245
  - lib/chemlab/runtime/browser.rb