number_to_indian_currency 1.0.5 → 1.0.6

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: 1b43b3ab79554ee45bf952178385b162a071c83a
4
- data.tar.gz: 14d8e4ace161a92d95f128b0e8bf87db3ca4b033
3
+ metadata.gz: 9045858ac6c7ea962143df808e1c592001baf9f2
4
+ data.tar.gz: 0445050545c4c5ee206bc4667bdc2e863042cc2c
5
5
  SHA512:
6
- metadata.gz: f1309dc020999a2bf7ffc1bec1f57acadddfb9cbf1b81c6e0edbf1bf9047a8d474d2af6ee38fb7759262d8bebf4fda2f8992deb8ea74a9da729d0902e5b72bf3
7
- data.tar.gz: 1023b0c0d0958af0047c99282542608b029aab1b1e02ac2bba346884072c94dda82519613b125c21d5ebf5e49bbcce62bcb0b4529ade5aa88d32ea683fd479d3
6
+ metadata.gz: b1d707bf53cbe86a86c906f3c83d19f7c329ae9a1432f6c591860db902cbec2ff2fb7f7d886d082534ea013efd046eb25c094ba68e97102de291fb88c975b1ad
7
+ data.tar.gz: a51f4c22f1258e9fbab8181a227aee6f98f9ee80465e1c0cc53a5da7458f3649009c94e69f20736c47a6e03b4e8548977c308f2d202001224771d6bbfebe0b61
@@ -1 +1 @@
1
- @font-face { font-family: "WebRupee"; font-style: normal; font-weight: normal; src: local("WebRupee"), url("http://cdn.webrupee.com/WebRupee.V2.0.ttf") format("truetype"), url("http://cdn.webrupee.com/WebRupee.V2.0.woff") format("woff"), url("http://cdn.webrupee.com/WebRupee.V2.0.svg") format("svg"); } .WebRupee { font-family: 'WebRupee'; }
1
+ @font-face { font-family: "WebRupee"; font-style: normal; font-weight: normal; src: local("WebRupee"), url("https://cdnjs.cloudflare.com/ajax/libs/WebRupee/2.0/WebRupee.V2.0.ttf") format("truetype"), url("https://cdnjs.cloudflare.com/ajax/libs/WebRupee/2.0/WebRupee.V2.0.woff") format("woff"), url("https://cdnjs.cloudflare.com/ajax/libs/WebRupee/2.0/WebRupee.V2.0.svg") format("svg"); } .WebRupee { font-family: 'WebRupee'; }
@@ -1,4 +1,6 @@
1
1
  require "number_to_indian_currency/version"
2
+ require "number_to_indian_currency/currency_helper"
3
+ require 'fileutils'
2
4
 
3
5
  module NumberToIndianCurrency
4
6
  def self.initialize
@@ -13,39 +15,19 @@ module NumberToIndianCurrency
13
15
  end
14
16
 
15
17
  def self.install
16
- require 'fileutils'
17
- orig = File.join(File.dirname(__FILE__), '../app/assets/stylesheets/.')
18
- dest = 'lib/assets/stylesheets'
19
- rupees_css = File.join(dest, 'rupees.css')
20
- unless File.exists?(rupees_css) && FileUtils.identical?(File.join(orig, 'rupees.css'), rupees_css)
21
- if File.exists?(rupees_css)
22
- begin
23
- puts "Removing..."
24
- FileUtils.rm rupees_css
25
- FileUtils.cp_r orig, dest
26
- rescue Exception => e
27
- puts e.message
28
- end
29
- else
30
- begin
31
- puts "Copying #{rupees_css}..."
32
- FileUtils.cp_r orig, dest
33
- rescue Exception => e
34
- puts e.message
35
- end
18
+ filename = 'rupees.css'
19
+ sourcefile = File.join('lib/assets/stylesheets', filename)
20
+ destfile = File.join(File.dirname(__FILE__), '../app/assets/stylesheets/', filename)
21
+ unless File.exists?(destfile) &&
22
+ FileUtils.identical?(destfile, sourcefile)
23
+ begin
24
+ FileUtils.mkdir_p File.dirname(destfile)
25
+ FileUtils.cp sourcefile, destfile
26
+ rescue Exception => e
27
+ puts e.message
36
28
  end
37
29
  end
38
30
  end
39
-
40
- module CurrencyHelper
41
- def number_to_indian_currency(number, options={})
42
- web_rupee = options.fetch(:web_rupee, false)
43
- text = options.fetch(:text, 'Rs.')
44
- text = content_tag(:span, text, class: :WebRupee) if web_rupee
45
- formatted_number = number.to_s.gsub(/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/, "\\1,")
46
- return [text, formatted_number].join
47
- end
48
- end
49
31
  end
50
32
 
51
33
  NumberToIndianCurrency.initialize
@@ -0,0 +1,11 @@
1
+ module NumberToIndianCurrency
2
+ module CurrencyHelper
3
+ def number_to_indian_currency(number, options={})
4
+ web_rupee = options.fetch(:web_rupee, false)
5
+ text = options.fetch(:text, 'Rs.')
6
+ text = content_tag(:span, text, class: :WebRupee) if web_rupee
7
+ formatted_number = number.to_s.gsub(/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/, "\\1,")
8
+ return [text, formatted_number].join
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module NumberToIndianCurrency
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
@@ -30,4 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "bundler", "~> 1.10"
31
31
  spec.add_development_dependency "rake", "~> 10.0"
32
32
  spec.add_development_dependency "minitest"
33
+ spec.add_development_dependency "mocha"
33
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: number_to_indian_currency
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandip Ransing
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-18 00:00:00.000000000 Z
11
+ date: 2015-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: mocha
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: number_to_indian_currency helper converts given number to the indian
56
70
  currency format (also displays Rupees symbol)
57
71
  email:
@@ -71,6 +85,7 @@ files:
71
85
  - bin/setup
72
86
  - lib/assets/stylesheets/rupees.css
73
87
  - lib/number_to_indian_currency.rb
88
+ - lib/number_to_indian_currency/currency_helper.rb
74
89
  - lib/number_to_indian_currency/version.rb
75
90
  - number_to_indian_currency.gemspec
76
91
  - tasks/currency.rake