accounts_client 0.2.11 → 0.2.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: faf4a0867fe309dad591c62f80bd461185f030f1
4
- data.tar.gz: d7350d7d1f0742fda214b909ca4c3f1a0be71776
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NjkxODc0ZDIwOGI1MzkzMzgyNjUyZWQ3YTJhMDFhNGQ3YzA3ZTkxZA==
5
+ data.tar.gz: !binary |-
6
+ NTJlMWU5NWE3YTM3Zjk4ODJhYjUzNmM5YzFkMzRkZDg5MTIzNjIyOQ==
5
7
  SHA512:
6
- metadata.gz: e1989989fdc76b76e30ad4d596f907a7899be4c7830b0858c9479035c8f7559965fc19893952ed07488a3749d0c61d669b0d114e611a5c830b2c9f72a8d9eacd
7
- data.tar.gz: 8a1ab67da0b13b69953db98296d0a3f8003eee27f64752bc1f45110e1cecd0bdc3e1f08f08bad7cceb8dcd8c5808fc92f6e435dc60726f6f642add360ca8d07f
8
+ metadata.gz: !binary |-
9
+ ZDBkOGNlYjBlMzVmNzExYWJhNTk1M2MwZjBhYjA4MThjMDVmMTliYTgxYzJi
10
+ MmZkY2ZhNjJhZTM1ZGQxYjNjNWNlNjNhMjFkY2I0NzQ1ZDg4ZmFiYTgyMDBm
11
+ OTQzNzY4MjUxNTdhYmRiNDcxNTFlOTY3NWY2NzAxNjU5MTE0Yzk=
12
+ data.tar.gz: !binary |-
13
+ ZTJkYWExZjNmMGI1NTFkYTVjY2RhOTJjZTkwODU4OTdiZTI1ZTgyM2U0MWY1
14
+ YjU3OTQ4MGVkZjMxZDgyNTJmYWU2NDExMjFmOWY4MTdiOTA2MTQ3YmFhNjc0
15
+ ZTUyNmNkNjg4N2I2YzdiYWJjZmNiN2Q0ZWRhN2QyZTg0MWY4MDY=
@@ -0,0 +1,20 @@
1
+ module EncodingHelper
2
+
3
+ # Encode value using user configuration
4
+ # This method assumes current_user exists
5
+ #
6
+ # @return [String]
7
+ def to_current_encoding(value)
8
+ encoded_value = nil
9
+ if !value.nil?
10
+ begin
11
+ encoded_value = value.encode(current_user.encoding)
12
+ rescue
13
+ encoded_value = value.force_encoding(current_user.encoding)
14
+ end
15
+ end
16
+ encoded_value
17
+ end
18
+
19
+
20
+ end
@@ -53,6 +53,25 @@ module Accounts
53
53
  self.padma.try(:enabled_accounts)
54
54
  end
55
55
 
56
+ # Returns CSV options associated with this user from PADMA ACCOUNTS
57
+ #
58
+ # @return [Hash]
59
+ def csv_options
60
+ options = CSV_DEFAULTS.clone
61
+ options[:col_sep] = self.padma.try :separator
62
+ options[:encoding] = self.padma.try :encoding
63
+
64
+ return options
65
+ end
66
+
67
+ def encoding
68
+ @encoding ||= self.padma.encoding
69
+ end
70
+
71
+ def separator
72
+ @separator ||= self.padma.separator
73
+ end
74
+
56
75
  private
57
76
 
58
77
  # Validates that current_account_name
@@ -71,4 +90,4 @@ module Accounts
71
90
 
72
91
  end
73
92
  end
74
- end
93
+ end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: accounts_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dwayne Macgowan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-05 00:00:00.000000000 Z
11
+ date: 2015-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: gravtastic
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '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
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: logical_model
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: 0.5.8
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.5.8
55
55
  description: This is client library for padma-Accounts-ws
@@ -59,6 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - app/helpers/encoding_helper.rb
62
63
  - app/models/padma_account.rb
63
64
  - app/models/padma_user.rb
64
65
  - config/initializers/accounts_client.rb
@@ -77,12 +78,12 @@ require_paths:
77
78
  - lib
78
79
  required_ruby_version: !ruby/object:Gem::Requirement
79
80
  requirements:
80
- - - ">="
81
+ - - ! '>='
81
82
  - !ruby/object:Gem::Version
82
83
  version: '0'
83
84
  required_rubygems_version: !ruby/object:Gem::Requirement
84
85
  requirements:
85
- - - ">="
86
+ - - ! '>='
86
87
  - !ruby/object:Gem::Version
87
88
  version: '0'
88
89
  requirements: []
@@ -92,3 +93,4 @@ signing_key:
92
93
  specification_version: 4
93
94
  summary: Client library for padma-Accounts-ws
94
95
  test_files: []
96
+ has_rdoc: