rubango 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NWYwNDg5ZWM5ODMyYWI2NDU1MzAzZTM4ZmY3MzBiOTk1M2Q4NjEwZQ==
5
+ data.tar.gz: !binary |-
6
+ NjZmYWIzYTFiMzY5Y2Y0ZWZhM2Q1Y2ZkM2JjODY4ZTM2YjM0MWE3Yg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZGU2YWM1N2IzY2U4MDkzNGJkMmY4NThjZDNmYmM4MTJiNjgyZGVjNDg5ZDVi
10
+ MWFiNTc1ZTBkZTMxM2E1MWVlZTAyYjA1YmQxN2RjZmEyYzgzYjI4MGNiZjNk
11
+ ZTRiNGE4Y2NhMjBlMjYyNGI0N2NmNzY0NWI4OTU3ZTQyZTM2ZmY=
12
+ data.tar.gz: !binary |-
13
+ NGE0ODM0ZDg3ZDBkNTRhYzdmMmFmMzUwODA1NjRlNjM5ZTVlMTQ1N2VhODE2
14
+ NjVhMWIyMzgzNDcwMjg0YzE1ZWE5YjRmYzE3NjUwYjE5NDk3Zjk2ZGNkNzdl
15
+ ZDE3NjE1YzBmNzE4ZTQ0NWUwOTVlNWQyM2EyN2U2OWJhMGJhZDg=
data/README.md CHANGED
@@ -1,3 +1,10 @@
1
+ UNMAINTAINED PROJECT WARNING
2
+ ============================
3
+
4
+ *This project is currently unmaintained*
5
+
6
+ Anyone who wishes to take it over, please let me know.
7
+
1
8
  rubango
2
9
  ================
3
10
 
@@ -2,14 +2,14 @@ module Totango
2
2
  class InvalidParamError < StandardError; end
3
3
 
4
4
  class ArgParser
5
- class <<self
5
+ class << self
6
6
  attr_reader :named_args
7
7
 
8
8
  def parse(args)
9
9
  new.tap do |parser|
10
10
  args.each do |arg, val|
11
11
  param = registered_args[arg]
12
- raise InvalidParamError, "'#{arg}' does not map to a valid param" unless param
12
+ param = custom_param_name(arg) unless param
13
13
 
14
14
  parser[param] = val
15
15
  end
@@ -31,30 +31,44 @@ module Totango
31
31
  @__registered_args__ ||= {}
32
32
  end
33
33
 
34
+ def custom_param_name(arg)
35
+ return "sdr_u.name" if arg == :user_name
36
+ return "sdr_u.ofid" if arg == :user_ofid
37
+
38
+ ["sdr_o", arg].join(".").to_sym
39
+ end
40
+
34
41
  def register_named_arg!(name)
35
42
  @named_args ||= []
36
43
  @named_args << name
37
44
  end
38
45
  end
39
46
 
40
- parses_arg :sdr_a, :a, :act, :activity
41
- parses_arg :sdr_o, :o, :org, :organization
42
- parses_arg :sdr_m, :m, :mod, :module
43
- parses_arg :sdr_u, :u, :user
44
- parses_arg :sdr_ofid, :ofid, :organization_foreign_id
47
+ parses_arg :sdr_a, :activity
48
+ parses_arg :sdr_o, :account_id
49
+ parses_arg :sdr_odn, :account_name
50
+ parses_arg :sdr_m, :module
51
+ parses_arg :sdr_u, :user_id
52
+ parses_arg :sdr_ofid, :organization_foreign_id
53
+
54
+ def values_hash
55
+ @__values_hash__ ||= {}
56
+ end
45
57
 
46
58
  def to_params
47
- ArgParser.named_args.map do |arg|
48
- [arg, CGI.escape(self[arg].to_s)].join("=")
49
- end.join("&")
59
+ args = (ArgParser.named_args + values_hash.keys).uniq
60
+
61
+ args.map do |arg|
62
+ [arg, CGI.escape(self[arg].to_s)].join("=") if arg && self[arg]
63
+ end.compact.join("&")
50
64
  end
51
65
 
52
66
  def [](arg)
53
- instance_variable_get :"@#{arg}"
67
+ values_hash[arg]
54
68
  end
55
69
 
56
70
  def []=(arg, val)
57
- instance_variable_set :"@#{arg}", val
71
+ values_hash[arg] = val
58
72
  end
59
73
  end
60
74
  end
@@ -3,8 +3,10 @@ module Totango
3
3
 
4
4
  module Resource
5
5
  @sp_defaults = {
6
- :organization => "Default Org",
7
- :user => "Default User",
6
+ :account_id => "Default Id",
7
+ :account_name => "Deafult name",
8
+ :user_id => "Default User ID",
9
+ :user_name => "Default User",
8
10
  :activity => "Default Activity",
9
11
  :module => "Default Module"
10
12
  }
@@ -1,3 +1,3 @@
1
1
  module Totango
2
- VERSION = "0.1.4" unless defined?(::Totango::VERSION)
2
+ VERSION = "0.1.5" unless defined?(::Totango::VERSION)
3
3
  end
metadata CHANGED
@@ -1,70 +1,116 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubango
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
5
- prerelease:
4
+ version: 0.1.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - jonah honeyman
8
+ - anirvan mandal
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-14 00:00:00.000000000 Z
12
+ date: 2014-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: pry
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ! '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: pry-stack_explorer
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: pry-debugger
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
14
56
  - !ruby/object:Gem::Dependency
15
57
  name: rspec
16
- requirement: &10599740 !ruby/object:Gem::Requirement
17
- none: false
58
+ requirement: !ruby/object:Gem::Requirement
18
59
  requirements:
19
60
  - - ! '>='
20
61
  - !ruby/object:Gem::Version
21
62
  version: '0'
22
63
  type: :development
23
64
  prerelease: false
24
- version_requirements: *10599740
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
25
70
  description: Enables easy integration of Totango tracking, with options for different
26
71
  ruby web frameworks
27
72
  email:
28
73
  - jonah@honeyman.org
74
+ - anirvan.mandal@gmail.com
29
75
  executables: []
30
76
  extensions: []
31
77
  extra_rdoc_files: []
32
78
  files:
33
- - lib/totango/version.rb
34
- - lib/totango/adapters/rails.rb
79
+ - LICENSE
80
+ - README.md
81
+ - lib/totango.rb
82
+ - lib/totango/adapter.rb
35
83
  - lib/totango/adapters/base.rb
36
84
  - lib/totango/adapters/merb.rb
37
- - lib/totango/tracker.rb
38
- - lib/totango/config.rb
39
- - lib/totango/adapter.rb
85
+ - lib/totango/adapters/rails.rb
40
86
  - lib/totango/arg_parser.rb
41
- - lib/totango/resource.rb
42
87
  - lib/totango/client.rb
43
- - lib/totango.rb
44
- - LICENSE
45
- - README.md
46
- homepage: https://github.com/jonuts/rubango
88
+ - lib/totango/config.rb
89
+ - lib/totango/resource.rb
90
+ - lib/totango/tracker.rb
91
+ - lib/totango/version.rb
92
+ homepage: https://github.com/nightfox/rubango
47
93
  licenses: []
94
+ metadata: {}
48
95
  post_install_message:
49
96
  rdoc_options: []
50
97
  require_paths:
51
98
  - lib
52
99
  required_ruby_version: !ruby/object:Gem::Requirement
53
- none: false
54
100
  requirements:
55
101
  - - ! '>='
56
102
  - !ruby/object:Gem::Version
57
103
  version: '0'
58
104
  required_rubygems_version: !ruby/object:Gem::Requirement
59
- none: false
60
105
  requirements:
61
106
  - - ! '>='
62
107
  - !ruby/object:Gem::Version
63
108
  version: 1.3.6
64
109
  requirements: []
65
110
  rubyforge_project: rubango
66
- rubygems_version: 1.8.10
111
+ rubygems_version: 2.2.2
67
112
  signing_key:
68
- specification_version: 3
113
+ specification_version: 4
69
114
  summary: API wrapper for Totango tracking integration
70
115
  test_files: []
116
+ has_rdoc: