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 +4 -4
- data/lib/chemlab/cli/new_library.rb +1 -1
- data/lib/chemlab/cli/stubber.rb +1 -1
- data/lib/chemlab/core_ext/string/inflections.rb +25 -0
- data/lib/chemlab/version.rb +1 -1
- metadata +3 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d84958e53d93ed46c4a4f93d1c236ae724b7f328ed010b0432ceef6c1ba23d21
|
4
|
+
data.tar.gz: 78df858369ff4a789f328bfb75f6ef550a594456b2ab57b0dcf44dd294c2772e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 '
|
19
|
+
require 'chemlab/core_ext/string/inflections'
|
20
20
|
|
21
21
|
@library = {
|
22
22
|
name: library_name,
|
data/lib/chemlab/cli/stubber.rb
CHANGED
@@ -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 '
|
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
|
data/lib/chemlab/version.rb
CHANGED
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.
|
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-
|
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
|