rebrandly 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: caf24ed175471cbc2765aadb9b261a055d931126
4
- data.tar.gz: 8b98d6fbb0ede8aafd49b1b43e6799b03f2f7184
3
+ metadata.gz: 9d987bcb3c97243117e4fe684a34aa9011ce775e
4
+ data.tar.gz: 7cda7ed562a981cf0ca3c452d577794bda7875b5
5
5
  SHA512:
6
- metadata.gz: 52c14cb4085f2931cc820df68bd10af61ad4bfa25c8ec5fbee0a5e321ab47cb4e4ea58350060b2c690acd48d0c54540a711fbd33734dffcff1d28a8259c8e838
7
- data.tar.gz: 916ae46f6e1b47be7cf6e57ac2811ad748414fa23b0255844c78d07dc905e402e67a5823a325c1e1d469d4e563628b8585d80fc9b46c963f6e4e4d71b10e95f3
6
+ metadata.gz: 2b497d03b435a84716cbced61af5626bb5bd9a8ffdad9530d95bc8262879c981ecb4d79ef6e6d5244cc043136846cd623c1724ee7461eb79509c62af825f3b2d
7
+ data.tar.gz: f8d5ed79995c886b9b0fd07ef665c0bee4d4453aa06caecadac7dbb0fdb41518a1a307a2a1369e9f2230c602c938a5f24a13d519c4f2dd3597ee0901019f5499
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /Gemfile.lock
data/lib/rebrandly.rb CHANGED
@@ -2,10 +2,10 @@ require 'rebrandly/version'
2
2
  require 'rebrandly/configuration'
3
3
  require 'rebrandly/api'
4
4
  require 'rebrandly/element'
5
- require 'rebrandly/link'
6
- require 'rebrandly/creator'
7
5
  require 'rebrandly/domain'
6
+ require 'rebrandly/creator'
8
7
  require 'rebrandly/integration'
8
+ require 'rebrandly/link'
9
9
 
10
10
  module Rebrandly
11
11
  class << self
@@ -26,7 +26,7 @@ module Rebrandly
26
26
  end
27
27
 
28
28
  class String
29
- def underscore
29
+ def rebrandly_underscore
30
30
  self.gsub(/::/, '/').
31
31
  gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
32
32
  gsub(/([a-z\d])([A-Z])/,'\1_\2').
@@ -34,21 +34,21 @@ class String
34
34
  downcase
35
35
  end
36
36
 
37
- def camelize
37
+ def rebrandly_camelize
38
38
  self.split('_').collect(&:capitalize).join
39
39
  end
40
40
 
41
- def lower_camelize
41
+ def rebrandly_lower_camelize
42
42
  res = self.camelize
43
43
  res[0].downcase + res[1..-1]
44
44
  end
45
45
  end
46
46
 
47
47
  class Hash
48
- def self.stringify_keys(hash)
48
+ def self.rebrandly_stringify_keys(hash)
49
49
  stringified_hash = {}
50
50
  hash.each do |k, v|
51
- stringified_hash[k.to_s] = v.is_a?(Hash) ? stringify_keys(v) : v
51
+ stringified_hash[k.to_s] = v.is_a?(Hash) ? rebrandly_stringify_keys(v) : v
52
52
  end
53
53
  stringified_hash
54
54
  end
data/lib/rebrandly/api.rb CHANGED
@@ -68,7 +68,7 @@ module Rebrandly
68
68
  def rebrandly_request(method, url, options={})
69
69
  url = "#{BASE_URL}/#{url}"
70
70
  # Convert all hash keys into camel case for Rebrandly
71
- options = Hash[options.map { |k,v| [k.to_s.lower_camelize.to_sym, v] }].to_json
71
+ options = Hash[options.map { |k,v| [k.to_s.rebrandly_lower_camelize.to_sym, v] }].to_json
72
72
 
73
73
  http_attrs = { headers: headers }
74
74
  case method
@@ -3,7 +3,7 @@ module Rebrandly
3
3
  class Element
4
4
  def initialize(attrs={})
5
5
  # Only set the attributes if the method exists, this way we can ignore deprecated attributes
6
- attrs.each { |k,v| send("#{k.underscore}=", v) if respond_to?("#{k.underscore}=") }
6
+ attrs.each { |k,v| send("#{k.rebrandly_underscore}=", v) if respond_to?("#{k.rebrandly_underscore}=") }
7
7
  end
8
8
 
9
9
  def to_h
@@ -8,7 +8,7 @@ module Rebrandly
8
8
 
9
9
 
10
10
  # Associations
11
- %i(domain creator integration).each do |association|
11
+ [:domain, :creator, :integration].each do |association|
12
12
  # Creates the getter methods, such as "@instance.domain"
13
13
  attr_reader association
14
14
 
@@ -17,7 +17,7 @@ module Rebrandly
17
17
  attrs ||= {}
18
18
 
19
19
  # Retrieve the class
20
- klass = Object.const_get("Rebrandly::#{association.to_s.camelize}")
20
+ klass = Rebrandly.const_get(association.to_s.rebrandly_camelize)
21
21
 
22
22
  # Ex:
23
23
  # @domain = Domain.new(attrs)
@@ -1,3 +1,3 @@
1
1
  module Rebrandly
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rebrandly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Davis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-10 00:00:00.000000000 Z
11
+ date: 2017-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.6.8
115
+ rubygems_version: 2.5.1
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: A Ruby Rebrandly Wrapper