daddy 0.1.26 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NTZjZmQxODc2YWMyYmQyNWJjYTMwYWU3ZDViNzFiNzQ4MmUxZTZiYw==
5
- data.tar.gz: !binary |-
6
- NGQwNjExMGNmYjM0NjAyOWVkZjk5NTIxM2U5MjAyZjU0ZTdlMGRiOQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- NDNmNDg2NGRiNWFmMjA4YWNhZjBkYTYyZjgxZWYzNTNhYWU2ZDAwNWQyOGUy
10
- OTUyMzI2NzJlNTExNTQ2YTI2ZGVmMzNjODZhYzQ1ZWJiODllMDVhNTA0NjE5
11
- MjQ4YjkwODAxZGU0ODIxYTc5OGYzM2MxMzA3ODdjOTgyYWMxMmI=
12
- data.tar.gz: !binary |-
13
- YTI3YWNjOGMzZTdiNmMxMjE5MGFmMDM5YjJmZjE2MTJhYzFiNmM1YzdiODNm
14
- YTQwZGIwNDM1M2RhOTIyMjlkNmEwZmMzMmJkYWNhNDI3NjliOWQxMWVjYmFk
15
- YjE1ZjJjY2U5MDUyNGZiODdkOWFlMDU1ZDViODkxMjE5NGUxYTQ=
2
+ SHA1:
3
+ metadata.gz: 921d4d355837267758f68e0e9aa026528f11114b
4
+ data.tar.gz: 880bb2227eea932c261258ba9e3d593bdca3b822
5
+ SHA512:
6
+ metadata.gz: 709552deea9399e5bc1650e377a1f4f944553ff123a8c25bc7ccb29f8dc677db22cdd4d80bf2fe1339db8e51e7321addf8017ace9bc0cf5be6ae5c9c74372582
7
+ data.tar.gz: f973b7f8c8e613deadc447ca9570745e96e15ae6ab6cee0d494cf0d909f9bada01e5f590e5b3f588bbe39e9fa84f1c4ec418f996c334edc7c7590226749615a7
@@ -11,6 +11,13 @@ end
11
11
 
12
12
  require 'sql_builder'
13
13
  require 'tax'
14
+ require 'daddy/utils/string_utils'
14
15
 
15
16
  module Daddy
17
+ require 'daddy/config'
18
+
19
+ def self.config
20
+ @_config ||= Daddy::Config.new(config_file = File.join('config', 'daddy.yml'))
21
+ end
22
+
16
23
  end
@@ -0,0 +1,19 @@
1
+ # coding: UTF-8
2
+
3
+ class Daddy::Config
4
+
5
+ def initialize(config_file)
6
+ if @config.nil?
7
+
8
+ if File.exist?(config_file)
9
+ @config = YAML.load_file(config_file)
10
+ end
11
+ end
12
+ @config
13
+ end
14
+
15
+ def use_feature_name?
16
+ @config && @config['cucumber'] && !!@config['use_feature_name']
17
+ end
18
+
19
+ end
@@ -5,7 +5,6 @@ require 'cucumber/formatter/ordered_xml_markup'
5
5
  require 'cucumber/formatter/duration'
6
6
  require 'cucumber/formatter/io'
7
7
  require 'daddy/formatter/daddy_html'
8
- require 'daddy/utils/string_utils'
9
8
 
10
9
  module Daddy
11
10
  module Formatter
@@ -126,9 +125,11 @@ module Daddy
126
125
  @builder.span(:class => 'val') do
127
126
  @builder << title
128
127
 
129
- subtitle = lines.first.to_s.strip
130
- unless subtitle.blank?
131
- @builder.span('(' + subtitle + ')', :class => 'feature_subtitle')
128
+ if Daddy.config.use_feature_name?
129
+ subtitle = lines.first.to_s.strip
130
+ unless subtitle.blank?
131
+ @builder.span('(' + subtitle + ')', :class => 'feature_subtitle')
132
+ end
132
133
  end
133
134
  end
134
135
  end
@@ -283,7 +284,7 @@ module Daddy
283
284
 
284
285
  file = $1.force_encoding('UTF-8')
285
286
  if file.start_with?('daddy-') or file.start_with?('/daddy-')
286
- file = '/usr/local/lib/ruby/gems/1.9.1/gems/' + file
287
+ file = '/usr/local/lib/ruby/gems/2.0.0/gems/' + file
287
288
  end
288
289
 
289
290
  File.readlines(File.expand_path(file))[line_index..-1].each do |line|
@@ -3,29 +3,23 @@
3
3
  require 'faraday'
4
4
 
5
5
  module Daddy
6
+
6
7
  class HttpClient
7
8
 
8
9
  def initialize(url, options = {})
9
10
  @url = url
10
11
  @options = options
11
12
  @cookie = options[:cookie]
12
- Rails.logger.debug "[HttpClient] url: #{@url}"
13
13
  end
14
14
 
15
15
  def get(path, params = {})
16
- Rails.logger.debug "[HttpClient] path: #{path}"
17
- Rails.logger.debug "[HttpClient] params: #{params}"
18
-
19
16
  response = connection.get(path, params) do |request|
20
17
  if @options[:auth_user] and @options[:auth_password]
21
18
  basic = 'Basic ' + Base64.encode64(@options[:auth_user] + ':' + @options[:auth_password])
22
- Rails.logger.debug "[HttpClient] authorization: #{basic}"
23
-
24
19
  request.headers['Authorization'] = basic
25
20
  end
26
21
 
27
22
  if @cookie
28
- Rails.logger.debug "[HttpClient] cookie: #{@cookie}"
29
23
  request.headers['Cookie'] = @cookie
30
24
  end
31
25
 
@@ -39,7 +33,6 @@ module Daddy
39
33
  if block_given?
40
34
  yield response
41
35
  else
42
- Rails.logger.debug "[HttpClient] stutus: #{response.status}"
43
36
  response.body.force_encoding('UTF-8')
44
37
  end
45
38
  end
@@ -27,13 +27,11 @@ tax.getRateOn = function(date) {
27
27
  return 0;
28
28
  };
29
29
 
30
- tax.calcTaxAmount = function(taxType, date, amount) {
30
+ tax.calcTaxAmount = function(taxType, rate, amount) {
31
31
  if ( isNaN( amount ) ) {
32
32
  return '';
33
33
  }
34
34
 
35
- var rate = this.getRateOn(date);
36
-
37
35
  if ( taxType == tax.TAX_TYPE_INCLUSIVE ) {
38
36
  return parseInt(amount * rate / (1 + rate));
39
37
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.26
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-07 00:00:00.000000000 Z
11
+ date: 2014-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -157,7 +157,7 @@ dependencies:
157
157
  - - ~>
158
158
  - !ruby/object:Gem::Version
159
159
  version: '3.2'
160
- - - ! '>='
160
+ - - '>='
161
161
  - !ruby/object:Gem::Version
162
162
  version: 3.2.0
163
163
  type: :runtime
@@ -167,7 +167,7 @@ dependencies:
167
167
  - - ~>
168
168
  - !ruby/object:Gem::Version
169
169
  version: '3.2'
170
- - - ! '>='
170
+ - - '>='
171
171
  - !ruby/object:Gem::Version
172
172
  version: 3.2.0
173
173
  - !ruby/object:Gem::Dependency
@@ -261,83 +261,83 @@ executables:
261
261
  extensions: []
262
262
  extra_rdoc_files: []
263
263
  files:
264
+ - bin/dad
264
265
  - lib/daddy.rb
266
+ - lib/daddy/config.rb
265
267
  - lib/daddy/cucumber.rb
266
- - lib/daddy/cucumber/pause.rb
267
- - lib/daddy/cucumber/puts.rb
268
+ - lib/daddy/cucumber/assert.rb
268
269
  - lib/daddy/cucumber/capture.rb
270
+ - lib/daddy/cucumber/diff.rb
269
271
  - lib/daddy/cucumber/formatting.rb
270
- - lib/daddy/cucumber/html.rb
271
272
  - lib/daddy/cucumber/hooks/database.rb
272
- - lib/daddy/cucumber/step_definitions/fill_in.rb
273
- - lib/daddy/cucumber/step_definitions/select.rb
273
+ - lib/daddy/cucumber/html.rb
274
+ - lib/daddy/cucumber/pause.rb
275
+ - lib/daddy/cucumber/puts.rb
274
276
  - lib/daddy/cucumber/step_definitions/click.rb
275
277
  - lib/daddy/cucumber/step_definitions/common.rb
276
- - lib/daddy/cucumber/assert.rb
278
+ - lib/daddy/cucumber/step_definitions/fill_in.rb
279
+ - lib/daddy/cucumber/step_definitions/select.rb
277
280
  - lib/daddy/cucumber/table.rb
278
- - lib/daddy/cucumber/diff.rb
279
- - lib/daddy/helpers/html_helper.rb
280
- - lib/daddy/capistrano/remote_cache_subdir.rb
281
- - lib/daddy/http_client.rb
282
- - lib/daddy/ocr.rb
283
- - lib/daddy/git.rb
284
- - lib/daddy/rails/engine.rb
285
- - lib/daddy/rails/railtie.rb
286
- - lib/daddy/rails/quiet_assets.rb
287
- - lib/daddy/model.rb
288
- - lib/daddy/formatter/menu.html.erb
289
- - lib/daddy/formatter/html.rb
290
- - lib/daddy/formatter/daddy_html.rb
291
- - lib/daddy/formatter/daddy.css
281
+ - lib/daddy/differ/html_patch.rb
292
282
  - lib/daddy/formatter/cucumber.css
283
+ - lib/daddy/formatter/daddy.css
293
284
  - lib/daddy/formatter/daddy.js
285
+ - lib/daddy/formatter/daddy_html.rb
286
+ - lib/daddy/formatter/html.rb
294
287
  - lib/daddy/formatter/jquery-min.js
288
+ - lib/daddy/formatter/menu.html.erb
289
+ - lib/daddy/git.rb
290
+ - lib/daddy/helpers/html_helper.rb
291
+ - lib/daddy/http_client.rb
292
+ - lib/daddy/model.rb
295
293
  - lib/daddy/models/crud_extension.rb
296
294
  - lib/daddy/models/query_extension.rb
297
- - lib/daddy/differ/html_patch.rb
295
+ - lib/daddy/ocr.rb
296
+ - lib/daddy/rails/engine.rb
297
+ - lib/daddy/rails/quiet_assets.rb
298
+ - lib/daddy/rails/railtie.rb
298
299
  - lib/daddy/utils/sql_utils.rb
299
300
  - lib/daddy/utils/string_utils.rb
300
301
  - lib/sql_builder.rb
301
- - lib/tax.rb
302
302
  - lib/ssl/cert.pem
303
- - lib/tasks/tesseract.rake
304
- - lib/tasks/jenkins
305
- - lib/tasks/nginx.repo
306
- - lib/tasks/nginx.jenkins.conf.erb
307
- - lib/tasks/jenkins.rake
303
+ - lib/tasks/cucumber.rake
304
+ - lib/tasks/cucumber_install.rake
305
+ - lib/tasks/cucumber_steps.rake
308
306
  - lib/tasks/dad.rake
307
+ - lib/tasks/database.yml.erb
309
308
  - lib/tasks/db_config.rake
310
- - lib/tasks/publish.rake
311
- - lib/tasks/cucumber_steps.rake
312
- - lib/tasks/unicorn.rb.erb
309
+ - lib/tasks/db_create.rake
313
310
  - lib/tasks/db_fixtures.rake
314
- - lib/tasks/cucumber.rake
315
- - lib/tasks/nginx.rake
316
- - lib/tasks/jenkins.conf
317
- - lib/tasks/generate/routes.rake
311
+ - lib/tasks/diary.rake
318
312
  - lib/tasks/generate/controller.rake
319
- - lib/tasks/generate/view.rake
320
- - lib/tasks/generate/templates/index.html.erb
321
- - lib/tasks/generate/templates/show.html.erb
322
- - lib/tasks/generate/templates/routes.rb.erb
313
+ - lib/tasks/generate/routes.rake
314
+ - lib/tasks/generate/templates/_form.html.erb
315
+ - lib/tasks/generate/templates/controller.rb.erb
323
316
  - lib/tasks/generate/templates/edit.html.erb
317
+ - lib/tasks/generate/templates/index.html.erb
324
318
  - lib/tasks/generate/templates/new.html.erb
325
- - lib/tasks/generate/templates/controller.rb.erb
326
- - lib/tasks/generate/templates/_form.html.erb
327
- - lib/tasks/cucumber_install.rake
328
- - lib/tasks/unicorn.rake
329
- - lib/tasks/diary.rake
330
- - lib/tasks/db_create.rake
331
- - lib/tasks/unicorn.erb
332
- - lib/tasks/test.rake
333
- - lib/tasks/phantomjs.rake
334
- - lib/tasks/database.yml.erb
319
+ - lib/tasks/generate/templates/routes.rb.erb
320
+ - lib/tasks/generate/templates/show.html.erb
321
+ - lib/tasks/generate/view.rake
322
+ - lib/tasks/jenkins
323
+ - lib/tasks/jenkins.conf
324
+ - lib/tasks/jenkins.rake
335
325
  - lib/tasks/nginx.app.conf.erb
336
326
  - lib/tasks/nginx.conf.erb
337
- - vendor/assets/javascripts/tax.js
327
+ - lib/tasks/nginx.jenkins.conf.erb
328
+ - lib/tasks/nginx.rake
329
+ - lib/tasks/nginx.repo
330
+ - lib/tasks/phantomjs.rake
331
+ - lib/tasks/publish.rake
332
+ - lib/tasks/tesseract.rake
333
+ - lib/tasks/test.rake
334
+ - lib/tasks/unicorn.erb
335
+ - lib/tasks/unicorn.rake
336
+ - lib/tasks/unicorn.rb.erb
337
+ - lib/tax.rb
338
338
  - vendor/assets/javascripts/daddy.js
339
339
  - vendor/assets/javascripts/string.js
340
- - bin/dad
340
+ - vendor/assets/javascripts/tax.js
341
341
  homepage: https://github.com/ichylinux/daddy
342
342
  licenses:
343
343
  - MIT
@@ -348,17 +348,17 @@ require_paths:
348
348
  - lib
349
349
  required_ruby_version: !ruby/object:Gem::Requirement
350
350
  requirements:
351
- - - ! '>='
351
+ - - '>='
352
352
  - !ruby/object:Gem::Version
353
353
  version: '0'
354
354
  required_rubygems_version: !ruby/object:Gem::Requirement
355
355
  requirements:
356
- - - ! '>='
356
+ - - '>='
357
357
  - !ruby/object:Gem::Version
358
358
  version: '0'
359
359
  requirements: []
360
360
  rubyforge_project:
361
- rubygems_version: 2.0.3
361
+ rubygems_version: 2.2.2
362
362
  signing_key:
363
363
  specification_version: 4
364
364
  summary: My rails dad
@@ -1,32 +0,0 @@
1
- # coding: UTF-8
2
-
3
- require 'capistrano/recipes/deploy/strategy/remote_cache'
4
-
5
- module Daddy
6
- module Capistrano
7
- class RemoteCacheSubdir < ::Capistrano::Deploy::Strategy::RemoteCache
8
-
9
- private
10
-
11
- def repository_cache_subdir
12
- if configuration[:deploy_subdir]
13
- File.join(repository_cache, configuration[:deploy_subdir])
14
- else
15
- repository_cache
16
- end
17
- end
18
-
19
- def copy_repository_cache
20
- logger.trace "copying the cached version to #{configuration[:release_path]}"
21
- if copy_exclude.empty?
22
- run "cp -RPp #{repository_cache_subdir} #{configuration[:release_path]} && #{mark}"
23
- else
24
- exclusions = copy_exclude.map { |e| "--exclude=\"#{e}\"" }.join(' ')
25
- run "rsync -lrpt #{exclusions} #{repository_cache_subdir}/* #{configuration[:release_path]} && #{mark}"
26
- end
27
- end
28
-
29
- end
30
- end
31
- end
32
-