administrate-field-money 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +6 -0
- data/README.md +7 -6
- data/administrate-field-money.gemspec +1 -1
- data/spec/lib/administrate/field/money_spec.rb +5 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1eda523410fc7e006a80ae1687af723d11e2311b74163b836ac418ae9320abf0
|
4
|
+
data.tar.gz: cfe145471695381ef11fc91e240183ae2daf7dc11c48c91d0ac29641a293933e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcab1f345074b6b150f362ba72e81a745e64b7928a43ddb6b236d47eec02b79293f7ecc90fa03a591b6d6dcc844859b8e12d34dc96d8f81482457eeefeb1fdc2
|
7
|
+
data.tar.gz: 23d0e265d88eaf9896c3bd799649174d539a404fd710064d53e7fa5e82250112b52aa95eb210dd94569fa722d316a09a17c56ea5fb2aa4b50eb362e695c9ab82
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.1
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v0.1.1](https://github.com/zooppa/administrate-field-money/tree/v0.1.1) (2018-10-11)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/zooppa/administrate-field-money/compare/v0.1.0...v0.1.1)
|
6
|
+
|
7
|
+
* Clarify expected attribute name (thanks @pkonovalov and @MatteoJoliveau)
|
8
|
+
|
3
9
|
## [v0.1.0](https://github.com/zooppa/administrate-field-money/tree/v0.1.0) (2018-03-06)
|
4
10
|
|
5
11
|
[Full Changelog](https://github.com/zooppa/administrate-field-money/compare/v0.0.6...v0.1.0)
|
data/README.md
CHANGED
@@ -1,20 +1,19 @@
|
|
1
1
|
# Administrate::Field::Money
|
2
2
|
|
3
|
-
[![Code Climate](https://codeclimate.com/github/zooppa/administrate-field-money/badges/gpa.svg)](https://codeclimate.com/github/zooppa/administrate-field-money)
|
4
3
|
[![Build Status](https://semaphoreci.com/api/v1/zooppa/administrate-field-money/branches/master/badge.svg)](https://semaphoreci.com/zooppa/administrate-field-money)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/zooppa/administrate-field-money/badges/gpa.svg)](https://codeclimate.com/github/zooppa/administrate-field-money)
|
5
5
|
|
6
6
|
A plugin to deal with money in [Administrate], with the help of [Money] gem.
|
7
7
|
|
8
|
-
**
|
9
|
-
|
10
|
-
![Demo](https://raw.githubusercontent.com/zooppa/administrate-field-money/master/demo.gif)
|
8
|
+
**IMPORTANT: this plugin expects the attribute to be an integer representing the
|
9
|
+
number of cents, with a name ending in `_cents`**.
|
11
10
|
|
12
11
|
## Usage
|
13
12
|
|
14
13
|
Add it to your `Gemfile`:
|
15
14
|
|
16
15
|
```ruby
|
17
|
-
gem 'administrate-field-money', '~> 0.1.
|
16
|
+
gem 'administrate-field-money', '~> 0.1.1'
|
18
17
|
```
|
19
18
|
|
20
19
|
Run:
|
@@ -27,7 +26,7 @@ Add to your `FooDashboard`:
|
|
27
26
|
|
28
27
|
```ruby
|
29
28
|
ATTRIBUTE_TYPES = {
|
30
|
-
|
29
|
+
amount_cents: Field::Money.with_options(
|
31
30
|
code: 'USD', # EUR, CAD, GBP, AUD, JPY, ...
|
32
31
|
symbol: '$',
|
33
32
|
delimiter: ',',
|
@@ -38,6 +37,8 @@ ATTRIBUTE_TYPES = {
|
|
38
37
|
|
39
38
|
The field will figure out the appropriate thousand separator and decimal delimiter for the unit.
|
40
39
|
|
40
|
+
![Demo](https://raw.githubusercontent.com/zooppa/administrate-field-money/master/demo.gif)
|
41
|
+
|
41
42
|
## About
|
42
43
|
|
43
44
|
Administrate::Field::Money is maintained by [Zooppa].
|
@@ -2,7 +2,7 @@ $:.push File.expand_path('../lib', __FILE__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'administrate-field-money'
|
5
|
-
gem.version = '0.1.
|
5
|
+
gem.version = '0.1.1'
|
6
6
|
gem.authors = ['Michele Gerarduzzi']
|
7
7
|
gem.email = ['michele.gerarduzzi@gmail.com']
|
8
8
|
gem.homepage = 'https://github.com/zooppa/administrate-field-money'
|
@@ -48,6 +48,11 @@ describe Administrate::Field::Money do
|
|
48
48
|
allow(subject).to receive(:symbol).and_return('€')
|
49
49
|
expect(output).to eq '€1.99'
|
50
50
|
end
|
51
|
+
|
52
|
+
it 'returns the formatted amount without a symbol' do
|
53
|
+
allow(subject).to receive(:symbol).and_return(nil)
|
54
|
+
expect(output).to eq '1.99'
|
55
|
+
end
|
51
56
|
end
|
52
57
|
end
|
53
58
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administrate-field-money
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michele Gerarduzzi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: administrate
|
@@ -95,6 +95,7 @@ extra_rdoc_files: []
|
|
95
95
|
files:
|
96
96
|
- ".gitignore"
|
97
97
|
- ".rspec"
|
98
|
+
- ".ruby-version"
|
98
99
|
- CHANGELOG.md
|
99
100
|
- Gemfile
|
100
101
|
- LICENSE.md
|
@@ -130,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
131
|
version: '0'
|
131
132
|
requirements: []
|
132
133
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.7.
|
134
|
+
rubygems_version: 2.7.7
|
134
135
|
signing_key:
|
135
136
|
specification_version: 4
|
136
137
|
summary: Money field plugin for Administrate
|