dekiru 0.3.0 → 0.3.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: 54b13a45f83b83696f4798dc3af4befcb07682e86fdbc9aae2366d3b94524aac
4
- data.tar.gz: 73a0c2739cd8e0d96486aabe942bc0a62641473d8f23baad150bab7bcbf27907
3
+ metadata.gz: 53ac90388f6a6f6d56a8e61897f62c4963e78250731f004f9a8eb21105b20c0d
4
+ data.tar.gz: d6b94ccc5a44ef605c652aa78a28c40ef72da2262f3024471f325da851f65cf7
5
5
  SHA512:
6
- metadata.gz: 10f74414b41a234c0b3c4fac407946ffc0348c692731cd8c10b99d47644b27dc640c19ee49a2ce1d7dc6f50bde201995593efddbc183e4d76307f312788f796c
7
- data.tar.gz: ce2c7c2330ac94f1de33bae835920897c9edcbaca64f11c05b3a50513d4ffb007e4c99a99f7e39b6e05a9bc1dd133443adff8fd7ba7a65fd68713dd11b6edc3e
6
+ metadata.gz: a367514ad2e6d1f761f9b8f69893b25cbe785596be1ee3c978e9e31842d448cbc77a8ae37888a3306fab83c6d6b122b5898c54e90fd8326708ea2eb7c10a30f2
7
+ data.tar.gz: 2c2f24e2d8419d073563fd46f42da3df0d265c6c92d9de1fc5477c9d75ba6539968672519a00de7d699b56b267cdb10b990106bf68438cff00cca060e9b42286
data/README.md CHANGED
@@ -2,11 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/mataki/dekiru.svg?branch=master)](https://travis-ci.org/mataki/dekiru)
4
4
 
5
- Usefull Helper methods for Ruby on Rails
6
-
7
- ## Rails version support
8
-
9
- Rails 5.1 は ~> 0.1.0
5
+ Useful Helper methods for Ruby on Rails
10
6
 
11
7
  ## Installation
12
8
 
data/dekiru.gemspec CHANGED
@@ -17,12 +17,12 @@ Gem::Specification.new do |gem|
17
17
 
18
18
  gem.required_ruby_version = '>= 2.7.0'
19
19
 
20
- gem.add_dependency 'http_accept_language', [">= 2.0.0"]
21
- gem.add_dependency 'rails'
20
+ gem.add_dependency 'http_accept_language', '>= 2.0.0'
21
+ gem.add_dependency 'rails', '>= 6.0'
22
22
  gem.add_dependency 'ruby-progressbar'
23
- gem.add_development_dependency 'rake', [">= 0"]
23
+ gem.add_development_dependency 'rake'
24
24
  gem.add_development_dependency 'rspec'
25
25
  gem.add_development_dependency 'rubocop'
26
- gem.add_development_dependency 'webmock', ['>= 1.19.0']
26
+ gem.add_development_dependency 'webmock', '>= 1.19.0'
27
27
  gem.add_development_dependency 'byebug'
28
28
  end
@@ -4,7 +4,6 @@ module Dekiru
4
4
  class JsNoErrorMatcher
5
5
  def matches?(page_or_logs)
6
6
  logs = if page_or_logs.respond_to?(:driver)
7
- ActiveSupport::Deprecation.warn('[dekiru] call have_no_js_errors with page is deprecated. please call with logs.')
8
7
  page_or_logs.driver.browser.logs.get(:browser)
9
8
  else
10
9
  page_or_logs
@@ -3,15 +3,21 @@ require 'http_accept_language'
3
3
  module Dekiru
4
4
  module ControllerAdditions
5
5
  def set_locale
6
+ ActiveSupport::Deprecation.warn('`set_locale` is deprecated and will be removed in v0.4.')
7
+
6
8
  I18n.locale = locale_from_params || locale_from_header
7
9
  logger.info "[locale] #{I18n.locale}"
8
10
  end
9
11
 
10
12
  def locale_from_params
13
+ ActiveSupport::Deprecation.warn('`locale_from_params` is deprecated and will be removed in v0.4.')
14
+
11
15
  (I18n.available_locales & [params[:locale].try(:to_sym)]).first
12
16
  end
13
17
 
14
18
  def locale_from_header
19
+ ActiveSupport::Deprecation.warn('`locale_from_header` is deprecated and will be removed in v0.4.')
20
+
15
21
  logger.debug "[debug] #{http_accept_language.user_preferred_languages}"
16
22
  http_accept_language.compatible_language_from(I18n.available_locales)
17
23
  end
@@ -11,8 +11,8 @@ module Dekiru
11
11
  def initialize(title, options = {})
12
12
  @title = title
13
13
  @options = options
14
- @stream = @options[:output] || $stdout
15
- @without_transaction = @options[:without_transaction] || false
14
+ @stream = @options.fetch(:output, $stdout)
15
+ @without_transaction = @options.fetch(:without_transaction, false)
16
16
  @side_effects = Hash.new do |hash, key|
17
17
  hash[key] = Hash.new(0)
18
18
  end
@@ -122,7 +122,7 @@ module Dekiru
122
122
  end
123
123
 
124
124
  def run(&block)
125
- if @options[:warning_side_effects]
125
+ if @options.fetch(:warning_side_effects, true)
126
126
  warning_side_effects(&block)
127
127
  else
128
128
  instance_eval(&block)
data/lib/dekiru/helper.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  module Dekiru
2
2
  module Helper
3
3
  def menu_link_to(name = nil, options = nil, html_options = nil, &block)
4
+ ActiveSupport::Deprecation.warn('`menu_link_to` is deprecated and will be removed in v0.4.')
5
+
4
6
  args = [name, options, html_options]
5
7
  html_options, options, name = options, name, block if block_given?
6
8
 
@@ -25,12 +27,16 @@ module Dekiru
25
27
  alias nl null_check_localization
26
28
 
27
29
  def facebook_like(url = url_for(only_path: false), app_id = nil, width = 140)
30
+ ActiveSupport::Deprecation.warn('`facebook_like` is deprecated and will be removed in v0.4.')
31
+
28
32
  facebook_app_id = app_id || ENV['FACEBOOK_APP_ID']
29
33
  html = %Q(<iframe src="//www.facebook.com/plugins/like.php?href=#{u(url)}&amp;send=false&amp;layout=button_count&amp;width=140&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=21&amp;appId=#{facebook_app_id}" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:#{width}px; height:21px;" allowTransparency="true"></iframe>)
30
34
  html.html_safe
31
35
  end
32
36
 
33
37
  def twitter_tweet
38
+ ActiveSupport::Deprecation.warn('`twitter_tweet` is deprecated and will be removed in v0.4.')
39
+
34
40
  html = <<-EOF
35
41
  <a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>
36
42
  <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
@@ -39,6 +45,8 @@ EOF
39
45
  end
40
46
 
41
47
  def google_plus
48
+ ActiveSupport::Deprecation.warn('`google_plus` is deprecated and will be removed in v0.4.')
49
+
42
50
  html = <<-EOF
43
51
  <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
44
52
  <g:plusone size="medium"></g:plusone>
@@ -47,6 +55,8 @@ EOF
47
55
  end
48
56
 
49
57
  def google_analytics(code, options = {})
58
+ ActiveSupport::Deprecation.warn('`google_analytics` is deprecated and will be removed in v0.4.')
59
+
50
60
  if code.present? && ::Rails.env == 'production'
51
61
  multi_subdomain = if options[:domain]
52
62
  "_gaq.push(['_setDomainName', '#{options[:domain]}']);"
@@ -1,3 +1,3 @@
1
1
  module Dekiru
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dekiru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akihiro Matsumura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-12 00:00:00.000000000 Z
11
+ date: 2022-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http_accept_language
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '6.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '6.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ruby-progressbar
43
43
  requirement: !ruby/object:Gem::Requirement