uni_sender 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Guardfile ADDED
@@ -0,0 +1,8 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard 'rspec', :version => 2, :cli => '--color' do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
+ watch('spec/spec_helper.rb') { "spec" }
8
+ end
data/README.rdoc CHANGED
@@ -14,11 +14,11 @@ Or you can install it via gem command
14
14
 
15
15
  == Getting Started
16
16
 
17
- Gem provide class UniSender::Client for accessing server. For creating client you need you personal key
17
+ Gem provide class UniSender::Client for accessing server's api. For creating client you need you personal key
18
18
 
19
19
  client = UniSender::Client.new('your secret key')
20
20
 
21
- Gem provides non-sensitive style, so action getLits will equal to get_lists or Get_List
21
+ Gem provides non-sensitive style, so action getLits will equal to get_lists or Get_Lists
22
22
 
23
23
  For getting contacts call client.exportContacts(or export_clients ;) ). If request will be accepted client return hash in format
24
24
 
@@ -38,7 +38,7 @@ Hash will decode to variables of 2 level, for example:
38
38
 
39
39
  == Dependencies
40
40
 
41
- That gem supports ruby 1.8+
41
+ That gem supports ruby 1.8+
42
42
 
43
43
  == Wikis
44
44
 
data/Rakefile CHANGED
@@ -1,8 +1,2 @@
1
1
  #!/usr/bin/env rake
2
2
  require "bundler/gem_tasks"
3
-
4
-
5
- desc 'Spec all functionality of gem'
6
- task :spec_all do
7
- system("rspec spec/*/")
8
- end
@@ -1,3 +1,3 @@
1
1
  module UniSender
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/uni_sender.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require "uni_sender/version"
2
2
  require 'uni_sender/camelize'
3
- require 'open-uri'
3
+ require 'net/http'
4
4
  require 'json'
5
5
 
6
6
  module UniSender
@@ -52,11 +52,12 @@ module UniSender
52
52
  params = translate_params(params) if defined?('translate_params')
53
53
  params.merge!({'api_key'=>api_key, 'format'=>'json'})
54
54
  query = make_query(params)
55
- JSON.parse(open("http://www.unisender.com/#{locale}/api/#{action}?#{query}").read)
55
+ url = URI("http://api.unisender.com/#{locale}/api/#{action}?#{query}")
56
+ JSON.parse(Net::HTTP.get(url))
56
57
  end
57
58
 
58
59
  def make_query(params)
59
- params.map{|key, value| value.nil? ? "" : "#{key}=#{value}"}.join('&')
60
+ params.map{|key, value| value.nil? ? "" : "#{key}=#{value}"}.reject(&:empty?).join('&')
60
61
  end
61
62
 
62
63
  end
@@ -2,12 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  describe UniSender::Client do
4
4
 
5
- it 'should get invalid key error' do
6
- answer = UniSender::Client.new("").getList
7
- answer['error'].should_not be_nil
8
- answer['code'].should == 'invalid_api_key'
9
- end
10
-
11
- specify{ test_client.get_lists.should == test_client.getLists}
5
+ specify { test_client.get_lists.should == test_client.getLists }
12
6
 
13
7
  end
data/uni_sender.gemspec CHANGED
@@ -10,6 +10,8 @@ Gem::Specification.new do |gem|
10
10
 
11
11
  gem.add_development_dependency 'rspec'
12
12
  gem.add_development_dependency 'ruby-debug'
13
+ gem.add_development_dependency 'guard-rspec'
14
+ gem.add_development_dependency 'ruby_gntp'
13
15
  gem.add_dependency 'json'
14
16
 
15
17
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uni_sender
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sergey Pchelincev
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-09 00:00:00 +03:00
19
- default_executable:
18
+ date: 2012-05-21 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: rspec
@@ -47,7 +46,7 @@ dependencies:
47
46
  type: :development
48
47
  version_requirements: *id002
49
48
  - !ruby/object:Gem::Dependency
50
- name: json
49
+ name: guard-rspec
51
50
  prerelease: false
52
51
  requirement: &id003 !ruby/object:Gem::Requirement
53
52
  none: false
@@ -58,8 +57,36 @@ dependencies:
58
57
  segments:
59
58
  - 0
60
59
  version: "0"
61
- type: :runtime
60
+ type: :development
62
61
  version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ name: ruby_gntp
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ hash: 3
71
+ segments:
72
+ - 0
73
+ version: "0"
74
+ type: :development
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: json
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ hash: 3
85
+ segments:
86
+ - 0
87
+ version: "0"
88
+ type: :runtime
89
+ version_requirements: *id005
63
90
  description: Gem that provide access to unisender.com.ua api
64
91
  email:
65
92
  - jalkoby91@gmail.com
@@ -72,6 +99,7 @@ extra_rdoc_files: []
72
99
  files:
73
100
  - .gitignore
74
101
  - Gemfile
102
+ - Guardfile
75
103
  - README.rdoc
76
104
  - Rakefile
77
105
  - lib/uni_sender.rb
@@ -84,7 +112,6 @@ files:
84
112
  - spec/spec.opt
85
113
  - spec/spec_helper.rb
86
114
  - uni_sender.gemspec
87
- has_rdoc: true
88
115
  homepage: ""
89
116
  licenses: []
90
117
 
@@ -114,9 +141,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
141
  requirements: []
115
142
 
116
143
  rubyforge_project:
117
- rubygems_version: 1.5.3
144
+ rubygems_version: 1.8.10
118
145
  signing_key:
119
146
  specification_version: 3
120
147
  summary: See description
121
- test_files: []
122
-
148
+ test_files:
149
+ - spec/data_macros.rb
150
+ - spec/functionality/common_spec.rb
151
+ - spec/functionality/managing_email_spec.rb
152
+ - spec/functionality/managing_list_spec.rb
153
+ - spec/spec.opt
154
+ - spec/spec_helper.rb
155
+ has_rdoc: