currency_select 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -6
- data/README.md +12 -7
- data/VERSION +1 -1
- data/currency_select.gemspec +6 -6
- data/lib/currency_select.rb +5 -5
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0517d3f18d5cdba188efed20ecad2a2b386ca93311469b2852588cc2a6b5b1cd
|
4
|
+
data.tar.gz: b8749dc246a0bde1ad45f9ff3319798fd22e35502a363ed77da766966b4becdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ed63a3fa3a5a8646b0e55914e6180c89d854fc34c219b68b58a832c387e33407b3fc3cf1934ebbb7b6b4b9fa6f34e7c4e7c07a91dca287a2066b1b41eb05026
|
7
|
+
data.tar.gz: afafe32396e486175f6ceb569ce302a9b407ae917df36b31e0b6f3efcabcb00b418733c396b1922a9290805021618ef816c080529c59a7a1758dcc43f001d6db
|
data/CHANGELOG.md
CHANGED
@@ -6,16 +6,32 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
6
|
## x.y.z (unreleased)
|
7
7
|
|
8
8
|
### Added
|
9
|
-
- Officially support Rails 5.2
|
10
|
-
([#51](https://github.com/braingourmets/currency_select/pull/51))
|
11
|
-
- Add Ruby 2.5.1 to the Travis build matrix
|
12
|
-
([#49](https://github.com/braingourmets/currency_select/pull/49))
|
13
9
|
|
14
10
|
### Changed
|
15
11
|
|
16
12
|
### Deprecated
|
17
13
|
|
18
14
|
### Removed
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
|
18
|
+
### Security
|
19
|
+
|
20
|
+
## 2.0.0
|
21
|
+
|
22
|
+
### Added
|
23
|
+
- Add support for Rails 6.0
|
24
|
+
([#60](https://github.com/braingourmets/currency_select/pull/60))
|
25
|
+
- Officially support Rails 5.2
|
26
|
+
([#51](https://github.com/braingourmets/currency_select/pull/51))
|
27
|
+
- Add Ruby 2.5.1 to the Travis build matrix
|
28
|
+
([#49](https://github.com/braingourmets/currency_select/pull/49))
|
29
|
+
|
30
|
+
### Removed
|
31
|
+
- Drop support for Rails < 5.1
|
32
|
+
([#62](https://github.com/braingourmets/currency_select/pull/62))
|
33
|
+
- Drop support for Ruby < 2.4
|
34
|
+
([#61](https://github.com/braingourmets/currency_select/pull/61))
|
19
35
|
- Drop support for Ruby < 2.3
|
20
36
|
([#48](https://github.com/braingourmets/currency_select/pull/48))
|
21
37
|
|
@@ -27,8 +43,6 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
|
27
43
|
- Fix value call on Rails 5.2
|
28
44
|
([#47](https://github.com/braingourmets/currency_select/pull/47))
|
29
45
|
|
30
|
-
### Security
|
31
|
-
|
32
46
|
## 1.0.0
|
33
47
|
|
34
48
|
### Added
|
data/README.md
CHANGED
@@ -6,21 +6,27 @@
|
|
6
6
|
Adds a currency_select helper to Ruby on Rails projects, allowing you to get
|
7
7
|
a HTML select list of available currencies.
|
8
8
|
|
9
|
-
The list of currencies are provided by the
|
10
|
-
gem.
|
11
|
-
|
9
|
+
The list of currencies are provided by the
|
10
|
+
[Money gem](https://rubygems.org/gems/money).
|
12
11
|
|
13
12
|
## Installation
|
14
13
|
|
15
14
|
Add the following to your Gemfile:
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
```ruby
|
17
|
+
gem 'currency_select'
|
18
|
+
```
|
19
19
|
|
20
20
|
## Example
|
21
21
|
|
22
|
-
|
22
|
+
```ruby
|
23
|
+
currency_select('user', 'currency')
|
24
|
+
```
|
23
25
|
|
26
|
+
### form_for example
|
27
|
+
```
|
28
|
+
<%= f.currency_select(:currency, ["USD", "EUR", "CAD"], {}, {class: "form-control"}) -%>
|
29
|
+
```
|
24
30
|
|
25
31
|
## Contributing to this project
|
26
32
|
|
@@ -30,7 +36,6 @@ This project adheres to a [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
|
|
30
36
|
By participating in this project and its community, you are expected to uphold
|
31
37
|
this code.
|
32
38
|
|
33
|
-
|
34
39
|
## Maintainers
|
35
40
|
|
36
41
|
* [Oliver Klee](https://github.com/oliverklee)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0
|
data/currency_select.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
version = File.read(File.expand_path('
|
3
|
+
version = File.read(File.expand_path('VERSION', __dir__)).strip
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'currency_select'
|
@@ -8,17 +8,17 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.version = version
|
9
9
|
s.license = 'MIT'
|
10
10
|
|
11
|
-
s.required_ruby_version = '>= 2.
|
11
|
+
s.required_ruby_version = '>= 2.4.0'
|
12
12
|
|
13
13
|
s.homepage = 'https://github.com/braingourmets/currency_select'
|
14
14
|
s.authors = ['Trond Arve Nordheim', 'Oliver Klee']
|
15
15
|
s.email = 'o.klee@braingourmets.com'
|
16
16
|
|
17
|
-
s.files = %w
|
18
|
-
s.extra_rdoc_files = %w
|
17
|
+
s.files = %w[lib/currency_select.rb rails/init.rb CHANGELOG.md CODE_OF_CONDUCT.md currency_select.gemspec Gemfile LICENSE Rakefile README.md VERSION]
|
18
|
+
s.extra_rdoc_files = %w[CHANGELOG.md LICENSE README.md]
|
19
19
|
|
20
|
-
s.add_runtime_dependency 'actionview', '>=
|
20
|
+
s.add_runtime_dependency 'actionview', '>= 5.1.0', '< 6.1'
|
21
21
|
s.add_runtime_dependency 'money', '~> 6.0'
|
22
22
|
|
23
|
-
s.add_development_dependency 'rspec-rails', '~> 3.8'
|
23
|
+
s.add_development_dependency 'rspec-rails', '~> 3.8.2'
|
24
24
|
end
|
data/lib/currency_select.rb
CHANGED
@@ -55,7 +55,7 @@ module CurrencySelect
|
|
55
55
|
# @return [Array]
|
56
56
|
#
|
57
57
|
def priority_currencies_array(currency_codes = [])
|
58
|
-
currency_codes.flat_map {|code| currencies_array.select {|currency| currency.last.to_s == code}}
|
58
|
+
currency_codes.flat_map { |code| currencies_array.select { |currency| currency.last.to_s == code } }
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
@@ -80,7 +80,7 @@ module ActionView
|
|
80
80
|
currency_options = ''.html_safe
|
81
81
|
|
82
82
|
if priority_currencies
|
83
|
-
currency_options += options_for_select(::CurrencySelect
|
83
|
+
currency_options += options_for_select(::CurrencySelect.priority_currencies_array(priority_currencies), selected)
|
84
84
|
currency_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\n".html_safe
|
85
85
|
|
86
86
|
# prevents selected from being included twice in the HTML which causes
|
@@ -90,7 +90,7 @@ module ActionView
|
|
90
90
|
end
|
91
91
|
|
92
92
|
# All the countries included in the country_options output.
|
93
|
-
|
93
|
+
currency_options + options_for_select(::CurrencySelect.currencies_array, selected)
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
@@ -98,7 +98,7 @@ module ActionView
|
|
98
98
|
def to_currency_select_tag(priority_currencies, options, html_options)
|
99
99
|
html_options = html_options.stringify_keys
|
100
100
|
add_default_name_and_id(html_options)
|
101
|
-
value = if
|
101
|
+
value = if method(:value).arity == 0
|
102
102
|
value()
|
103
103
|
else
|
104
104
|
value(object)
|
@@ -113,7 +113,7 @@ module ActionView
|
|
113
113
|
|
114
114
|
class FormBuilder
|
115
115
|
def currency_select(method, priority_currencies = nil, options = {}, html_options = {})
|
116
|
-
@template.currency_select(@object_name, method, priority_currencies, options.merge(:
|
116
|
+
@template.currency_select(@object_name, method, priority_currencies, options.merge(object: @object), html_options)
|
117
117
|
end
|
118
118
|
end
|
119
119
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: currency_select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trond Arve Nordheim
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-09-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionview
|
@@ -17,20 +17,20 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 5.1.0
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '6.
|
23
|
+
version: '6.1'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
28
|
- - ">="
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version:
|
30
|
+
version: 5.1.0
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '6.
|
33
|
+
version: '6.1'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: money
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -51,14 +51,14 @@ dependencies:
|
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 3.8.2
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 3.8.2
|
62
62
|
description:
|
63
63
|
email: o.klee@braingourmets.com
|
64
64
|
executables: []
|
@@ -90,15 +90,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
90
|
requirements:
|
91
91
|
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 2.
|
93
|
+
version: 2.4.0
|
94
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
|
-
|
101
|
-
rubygems_version: 2.7.7
|
100
|
+
rubygems_version: 3.0.6
|
102
101
|
signing_key:
|
103
102
|
specification_version: 4
|
104
103
|
summary: Currency select plugin for Rails
|