string_tools 0.8.0 → 0.9.0

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: b54d720e4356b89d27b09c3611d31dd5dadce76d
4
- data.tar.gz: a6463c7ebf8dd3356610f0ecded31324858ba77e
3
+ metadata.gz: bbc527ae231222a0bc1c1b205ef8a6a96f7ee55e
4
+ data.tar.gz: 5649eef667ac019d0c21466a0d4129806924401e
5
5
  SHA512:
6
- metadata.gz: 2ad9f231810b57b6839a14ec0a3d66d2f39458180d455647d608f4a236bacbdc15c7f530e6ec4218ae1522cc757826da940283bf71a7dc06b8439d817133e99e
7
- data.tar.gz: a6bc724b9024ce5ecc7be4d9ae9437318e002dcf163798565f37064ec173810a0b323488888bb07e67b3b3b6bc8d1826a64c375fe98a39fdcfa248db9785342e
6
+ metadata.gz: 6be1232a0b24035f7c896fb1266650f5c8856cc5e6224b189605ff2ad528f04617b42fd86b1632cc3915cfca6458f11ece6ef3691472ae0ca9670e749d8bb0a1
7
+ data.tar.gz: 9815767055681479260e355931db124af1f9e6c35d890946460344043c8a9d7e47ce8c0c39b4d5ca8212fc5d461d7afee8f4471e90fd3597a524b0ca4b5bbd2f
data/.drone.yml CHANGED
@@ -1,13 +1,6 @@
1
- matrix:
2
- include:
3
- - DOCKER_RUBY_VERSION: 2.2
4
- RUBY_IMAGE_TAG: 2.2-3
5
-
6
- - DOCKER_RUBY_VERSION: 1.9.3
7
- RUBY_IMAGE_TAG: 1.9.3-3
8
-
9
1
  build:
10
- image: abakpress/dind:3
2
+ image: abakpress/dind-testing
3
+ pull: true
11
4
  privileged: true
12
5
  volumes:
13
6
  - /home/data/drone/images:/images
@@ -15,14 +8,13 @@ build:
15
8
  - /home/data/drone/key_cache:/ssh_keys
16
9
  environment:
17
10
  - COMPOSE_FILE_EXT=drone
11
+ - RUBY_IMAGE_TAG=2.2-latest
18
12
  commands:
19
13
  - wrapdocker docker -v
20
14
 
21
- - if [ ! -e /images/ssh-agent.tar ]; then docker pull whilp/ssh-agent; docker save whilp/ssh-agent > /images/ssh-agent.tar; fi
22
- - if [ ! -e /images/ruby_$RUBY_IMAGE_TAG.tar ]; then docker pull abakpress/ruby:$RUBY_IMAGE_TAG; docker save abakpress/ruby:$RUBY_IMAGE_TAG > /images/ruby_$RUBY_IMAGE_TAG.tar; fi
23
-
24
- - docker load -i /images/ssh-agent.tar
25
- - docker load -i /images/ruby_$RUBY_IMAGE_TAG.tar
15
+ - fetch-images
16
+ --image whilp/ssh-agent
17
+ --image abakpress/ruby-app:$RUBY_IMAGE_TAG
26
18
 
27
19
  - dip ssh add -T -v /ssh_keys -k /ssh_keys/id_rsa
28
20
  - dip provision
data/Appraisals CHANGED
@@ -1,17 +1,9 @@
1
- appraise 'rails3.1' do
2
- gem 'activerecord', '~> 3.1.12'
3
- gem 'actionpack', '~> 3.1.12'
4
- gem 'activesupport', '~> 3.1.12'
5
- end
6
-
7
1
  appraise 'rails3.2' do
8
- gem 'activerecord', '~> 3.2.0'
9
2
  gem 'actionpack', '~> 3.2.0'
10
3
  gem 'activesupport', '~> 3.2.0'
11
4
  end
12
5
 
13
6
  appraise 'rails4.0' do
14
- gem 'activerecord', '~> 4.0.0'
15
7
  gem 'actionpack', '~> 4.0.0'
16
8
  gem 'activesupport', '~> 4.0.0'
17
9
  end
data/Gemfile CHANGED
@@ -2,9 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in string_tools.gemspec
4
4
  gemspec
5
-
6
- if RUBY_VERSION < '2'
7
- gem 'pry-debugger'
8
- else
9
- gem 'pry-byebug'
10
- end
data/dip.yml CHANGED
@@ -1,8 +1,8 @@
1
1
  version: '1'
2
2
 
3
3
  environment:
4
- DOCKER_RUBY_VERSION: 1.9.3
5
- RUBY_IMAGE_TAG: 1.9.3-3
4
+ DOCKER_RUBY_VERSION: 2.2
5
+ RUBY_IMAGE_TAG: 2.2-latest
6
6
  COMPOSE_FILE_EXT: development
7
7
  RAILS_ENV: test
8
8
 
data/docker-compose.yml CHANGED
@@ -2,7 +2,7 @@ version: '2'
2
2
 
3
3
  services:
4
4
  app:
5
- image: abakpress/ruby:$RUBY_IMAGE_TAG
5
+ image: abakpress/ruby-app:$RUBY_IMAGE_TAG
6
6
  environment:
7
7
  - SSH_AUTH_SOCK=/ssh/auth/sock
8
8
  - BUNDLE_PATH=/bundle/$DOCKER_RUBY_VERSION
@@ -3,8 +3,9 @@
3
3
  require 'rchardet19'
4
4
  require 'addressable/uri'
5
5
  require 'active_support/core_ext/module'
6
- require 'active_record'
6
+ require 'active_support/version'
7
7
  require 'action_pack'
8
+ require 'string_tools/string'
8
9
 
9
10
  class String
10
11
  %w[auto_link excerpt highlight sanitize simple_format word_wrap].each do |method|
@@ -30,7 +31,7 @@ class String
30
31
  alias_method_chain :to_f, :strip_comma
31
32
 
32
33
  def to_b
33
- ActiveRecord::ConnectionAdapters::Column.value_to_boolean(self) || false
34
+ StringTools::String.new(self).to_b
34
35
  end
35
36
 
36
37
  def to_script_safe_json
@@ -0,0 +1,20 @@
1
+ module StringTools
2
+ class String
3
+ TRUE_VALUES = %w(1 t T true TRUE on ON).to_set
4
+
5
+ def initialize(string)
6
+ @string = string.to_s
7
+ end
8
+
9
+ # Public: cast string value to boolean
10
+ #
11
+ # Example:
12
+ # StringTools::String.new('t').to_b
13
+ # #=> true
14
+ #
15
+ # Return boolean
16
+ def to_b
17
+ TRUE_VALUES.include?(@string)
18
+ end
19
+ end
20
+ end
@@ -1,3 +1,3 @@
1
1
  module StringTools
2
- VERSION = '0.8.0'
2
+ VERSION = '0.9.0'.freeze
3
3
  end
data/string_tools.gemspec CHANGED
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.add_runtime_dependency 'activerecord', '>= 3.1.12'
23
22
  spec.add_runtime_dependency 'actionpack', '>= 3.1.12'
24
23
  spec.add_runtime_dependency 'activesupport', '>= 3.1.12'
25
24
  spec.add_runtime_dependency 'rchardet19', '~> 1.3.5'
metadata CHANGED
@@ -1,265 +1,251 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: string_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey D.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-18 00:00:00.000000000 Z
11
+ date: 2017-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activerecord
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '>='
18
- - !ruby/object:Gem::Version
19
- version: 3.1.12
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '>='
25
- - !ruby/object:Gem::Version
26
- version: 3.1.12
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: actionpack
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
- - - '>='
17
+ - - ">="
32
18
  - !ruby/object:Gem::Version
33
19
  version: 3.1.12
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - '>='
24
+ - - ">="
39
25
  - !ruby/object:Gem::Version
40
26
  version: 3.1.12
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: activesupport
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
- - - '>='
31
+ - - ">="
46
32
  - !ruby/object:Gem::Version
47
33
  version: 3.1.12
48
34
  type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
- - - '>='
38
+ - - ">="
53
39
  - !ruby/object:Gem::Version
54
40
  version: 3.1.12
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: rchardet19
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - ~>
45
+ - - "~>"
60
46
  - !ruby/object:Gem::Version
61
47
  version: 1.3.5
62
48
  type: :runtime
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - ~>
52
+ - - "~>"
67
53
  - !ruby/object:Gem::Version
68
54
  version: 1.3.5
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: addressable
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - '>='
59
+ - - ">="
74
60
  - !ruby/object:Gem::Version
75
61
  version: 2.3.2
76
62
  type: :runtime
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - '>='
66
+ - - ">="
81
67
  - !ruby/object:Gem::Version
82
68
  version: 2.3.2
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: ru_propisju
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - '>='
73
+ - - ">="
88
74
  - !ruby/object:Gem::Version
89
75
  version: 2.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
82
  version: 2.1.4
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: sanitize
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
- - - '>='
87
+ - - ">="
102
88
  - !ruby/object:Gem::Version
103
89
  version: 3.1.2
104
90
  type: :runtime
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - '>='
94
+ - - ">="
109
95
  - !ruby/object:Gem::Version
110
96
  version: 3.1.2
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: nokogiri
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
- - - '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
- - - '>='
108
+ - - ">="
123
109
  - !ruby/object:Gem::Version
124
110
  version: '0'
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: simpleidn
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
- - - '>='
115
+ - - ">="
130
116
  - !ruby/object:Gem::Version
131
117
  version: 0.0.5
132
118
  type: :runtime
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
- - - '>='
122
+ - - ">="
137
123
  - !ruby/object:Gem::Version
138
124
  version: 0.0.5
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: bundler
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
- - - ~>
129
+ - - "~>"
144
130
  - !ruby/object:Gem::Version
145
131
  version: '1.7'
146
132
  type: :development
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
- - - ~>
136
+ - - "~>"
151
137
  - !ruby/object:Gem::Version
152
138
  version: '1.7'
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: rake
155
141
  requirement: !ruby/object:Gem::Requirement
156
142
  requirements:
157
- - - ~>
143
+ - - "~>"
158
144
  - !ruby/object:Gem::Version
159
145
  version: '10.0'
160
146
  type: :development
161
147
  prerelease: false
162
148
  version_requirements: !ruby/object:Gem::Requirement
163
149
  requirements:
164
- - - ~>
150
+ - - "~>"
165
151
  - !ruby/object:Gem::Version
166
152
  version: '10.0'
167
153
  - !ruby/object:Gem::Dependency
168
154
  name: rspec
169
155
  requirement: !ruby/object:Gem::Requirement
170
156
  requirements:
171
- - - '>='
157
+ - - ">="
172
158
  - !ruby/object:Gem::Version
173
159
  version: '3.4'
174
160
  type: :development
175
161
  prerelease: false
176
162
  version_requirements: !ruby/object:Gem::Requirement
177
163
  requirements:
178
- - - '>='
164
+ - - ">="
179
165
  - !ruby/object:Gem::Version
180
166
  version: '3.4'
181
167
  - !ruby/object:Gem::Dependency
182
168
  name: rspec-rails
183
169
  requirement: !ruby/object:Gem::Requirement
184
170
  requirements:
185
- - - '>='
171
+ - - ">="
186
172
  - !ruby/object:Gem::Version
187
173
  version: '3.4'
188
174
  type: :development
189
175
  prerelease: false
190
176
  version_requirements: !ruby/object:Gem::Requirement
191
177
  requirements:
192
- - - '>='
178
+ - - ">="
193
179
  - !ruby/object:Gem::Version
194
180
  version: '3.4'
195
181
  - !ruby/object:Gem::Dependency
196
182
  name: rspec-given
197
183
  requirement: !ruby/object:Gem::Requirement
198
184
  requirements:
199
- - - ~>
185
+ - - "~>"
200
186
  - !ruby/object:Gem::Version
201
187
  version: '3.5'
202
188
  type: :development
203
189
  prerelease: false
204
190
  version_requirements: !ruby/object:Gem::Requirement
205
191
  requirements:
206
- - - ~>
192
+ - - "~>"
207
193
  - !ruby/object:Gem::Version
208
194
  version: '3.5'
209
195
  - !ruby/object:Gem::Dependency
210
196
  name: shoulda-matchers
211
197
  requirement: !ruby/object:Gem::Requirement
212
198
  requirements:
213
- - - ~>
199
+ - - "~>"
214
200
  - !ruby/object:Gem::Version
215
201
  version: '2.0'
216
202
  type: :development
217
203
  prerelease: false
218
204
  version_requirements: !ruby/object:Gem::Requirement
219
205
  requirements:
220
- - - ~>
206
+ - - "~>"
221
207
  - !ruby/object:Gem::Version
222
208
  version: '2.0'
223
209
  - !ruby/object:Gem::Dependency
224
210
  name: appraisal
225
211
  requirement: !ruby/object:Gem::Requirement
226
212
  requirements:
227
- - - '>='
213
+ - - ">="
228
214
  - !ruby/object:Gem::Version
229
215
  version: 1.0.2
230
216
  type: :development
231
217
  prerelease: false
232
218
  version_requirements: !ruby/object:Gem::Requirement
233
219
  requirements:
234
- - - '>='
220
+ - - ">="
235
221
  - !ruby/object:Gem::Version
236
222
  version: 1.0.2
237
223
  - !ruby/object:Gem::Dependency
238
224
  name: combustion
239
225
  requirement: !ruby/object:Gem::Requirement
240
226
  requirements:
241
- - - '>='
227
+ - - ">="
242
228
  - !ruby/object:Gem::Version
243
229
  version: 0.5.3
244
230
  type: :development
245
231
  prerelease: false
246
232
  version_requirements: !ruby/object:Gem::Requirement
247
233
  requirements:
248
- - - '>='
234
+ - - ">="
249
235
  - !ruby/object:Gem::Version
250
236
  version: 0.5.3
251
237
  - !ruby/object:Gem::Dependency
252
238
  name: simplecov
253
239
  requirement: !ruby/object:Gem::Requirement
254
240
  requirements:
255
- - - '>='
241
+ - - ">="
256
242
  - !ruby/object:Gem::Version
257
243
  version: '0.9'
258
244
  type: :development
259
245
  prerelease: false
260
246
  version_requirements: !ruby/object:Gem::Requirement
261
247
  requirements:
262
- - - '>='
248
+ - - ">="
263
249
  - !ruby/object:Gem::Version
264
250
  version: '0.9'
265
251
  description: String Tools
@@ -269,14 +255,13 @@ executables: []
269
255
  extensions: []
270
256
  extra_rdoc_files: []
271
257
  files:
272
- - .drone.yml
273
- - .gitignore
274
- - .rspec
258
+ - ".drone.yml"
259
+ - ".gitignore"
260
+ - ".rspec"
275
261
  - Appraisals
276
262
  - CHANGELOG.md
277
263
  - Gemfile
278
264
  - LICENSE.txt
279
- - Makefile
280
265
  - README.md
281
266
  - Rakefile
282
267
  - bin/console
@@ -287,6 +272,7 @@ files:
287
272
  - lib/string_tools.rb
288
273
  - lib/string_tools/core_ext/string.rb
289
274
  - lib/string_tools/html.rb
275
+ - lib/string_tools/string.rb
290
276
  - lib/string_tools/version.rb
291
277
  - string_tools.gemspec
292
278
  homepage: https://github.com/abak-press/string_tools
@@ -299,17 +285,17 @@ require_paths:
299
285
  - lib
300
286
  required_ruby_version: !ruby/object:Gem::Requirement
301
287
  requirements:
302
- - - '>='
288
+ - - ">="
303
289
  - !ruby/object:Gem::Version
304
290
  version: '0'
305
291
  required_rubygems_version: !ruby/object:Gem::Requirement
306
292
  requirements:
307
- - - '>='
293
+ - - ">="
308
294
  - !ruby/object:Gem::Version
309
295
  version: '0'
310
296
  requirements: []
311
297
  rubyforge_project:
312
- rubygems_version: 2.0.14.1
298
+ rubygems_version: 2.6.8
313
299
  signing_key:
314
300
  specification_version: 4
315
301
  summary: String Tools
data/Makefile DELETED
@@ -1,23 +0,0 @@
1
- RAILS_ENV = test
2
- BUNDLE = RAILS_ENV=${RAILS_ENV} bundle
3
- BUNDLE_OPTIONS = -j 2
4
- RSPEC = rspec
5
- APPRAISAL = appraisal
6
-
7
- all: test
8
-
9
- test: bundler/install appraisal/install
10
- ${BUNDLE} exec ${APPRAISAL} ${RSPEC} spec 2>&1
11
-
12
- bundler/install:
13
- if ! gem list bundler -i > /dev/null; then \
14
- gem install bundler; \
15
- fi
16
- ${BUNDLE} install ${BUNDLE_OPTIONS}
17
-
18
- appraisal/install:
19
- ${BUNDLE} exec ${APPRAISAL} install
20
-
21
- clear:
22
- rm -rf gemfiles
23
- rm -f Gemfile.lock