glue 1.0.5 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
File without changes
data/Manifest.txt CHANGED
@@ -2,6 +2,5 @@ History.txt
2
2
  Manifest.txt
3
3
  README.txt
4
4
  Rakefile
5
- glue.gemspec
6
5
  lib/glue.rb
7
6
  test/test_glue.rb
data/README.txt CHANGED
File without changes
data/Rakefile CHANGED
@@ -5,8 +5,8 @@ require 'hoe'
5
5
  require './lib/glue.rb'
6
6
 
7
7
  Hoe.new('glue', Glue::VERSION) do |p|
8
+ # p.rubyforge_name = 'gluex' # if different than lowercase project name
8
9
  p.developer('Jordan Dobson', 'jordan.dobson@madebysquad.com')
9
- p.extra_deps = ['nokogiri']
10
10
  p.extra_deps = ['httparty']
11
11
  p.extra_dev_deps = ['mocha']
12
12
  p.remote_rdoc_dir = '' # Release to root
data/lib/glue.rb CHANGED
@@ -4,7 +4,7 @@ require 'open-uri'
4
4
 
5
5
  module Glue
6
6
 
7
- VERSION = '1.0.5'
7
+ VERSION = '1.1.0'
8
8
  DOMAIN = 'gluenow.com'
9
9
 
10
10
  class AuthError < StandardError; end
@@ -30,11 +30,17 @@ module Glue
30
30
  end
31
31
 
32
32
  def user_info
33
- self.class.post(USER, :query => {}, :basic_auth => @auth)
33
+ response = self.class.post(
34
+ USER,
35
+ :query => {},
36
+ :basic_auth => @auth
37
+ )
38
+ response['rsp'] ? response : {}
39
+
34
40
  end
35
41
 
36
42
  def post title, body, *opts
37
- self.class.post(
43
+ response = self.class.post(
38
44
  POST,
39
45
  :query => {
40
46
  :title => title,
@@ -43,6 +49,8 @@ module Glue
43
49
  :author => opts.include?( :author ) },
44
50
  :basic_auth => @auth
45
51
  )
52
+ response['rsp'] ? response : {}
53
+
46
54
  end
47
55
 
48
56
  private
@@ -68,4 +76,4 @@ module Glue
68
76
 
69
77
  end
70
78
 
71
- end
79
+ end
data/test/test_glue.rb CHANGED
@@ -20,9 +20,9 @@ class TestGlue < Test::Unit::TestCase
20
20
  @guid = "#{@lurl}##{@id}"
21
21
  @guid2 = "#{@lurl}##{@id2}"
22
22
  @author = "Jordan"
23
- @login_html = '<html><body id="login"></body></html>'
24
23
 
25
24
  @resp_fail = {}
25
+ @resp_html = {"html"=>{"head"=>{"title" => "GLUE | Web + Mobile Publishing"}}}
26
26
 
27
27
  @resp_ok = { "rsp" => {
28
28
  "user" => {
@@ -137,13 +137,13 @@ class TestGlue < Test::Unit::TestCase
137
137
  end
138
138
 
139
139
  def test_user_info_invalid
140
- Glue::API.stubs(:post).returns(@resp_fail)
140
+ Glue::API.stubs(:post).returns(@resp_html)
141
141
  actual = @client.user_info
142
142
  assert_equal @resp_fail, actual
143
143
  end
144
144
 
145
145
  def test_bad_post_response
146
- Glue::API.stubs(:post).returns(@resp_fail)
146
+ #Glue::API.stubs(:post).returns(@resp_html)
147
147
  actual = @client.post(@title, @body)
148
148
  assert_equal @resp_fail, actual
149
149
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glue
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Dobson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-28 00:00:00 -07:00
12
+ date: 2009-08-29 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 2.3.3
43
+ version: 1.12.2
44
44
  version:
45
45
  description: |-
46
46
  The Glue gem enables posting to GlueNow.com API service using an account subdomain, username, password. In this version you can add a post by providing a title, body, optional author name and optional private settings. You can also access some basic info about a users account and check if their account info is valid.
@@ -61,7 +61,6 @@ files:
61
61
  - Manifest.txt
62
62
  - README.txt
63
63
  - Rakefile
64
- - glue.gemspec
65
64
  - lib/glue.rb
66
65
  - test/test_glue.rb
67
66
  has_rdoc: true
@@ -89,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
88
  requirements: []
90
89
 
91
90
  rubyforge_project: glue
92
- rubygems_version: 1.3.4
91
+ rubygems_version: 1.3.3
93
92
  signing_key:
94
93
  specification_version: 3
95
94
  summary: The Glue gem enables posting to GlueNow.com API service using an account subdomain, username, password
data/glue.gemspec DELETED
@@ -1,42 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = %q{glue}
5
- s.version = "1.0.5"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Jordan Dobson"]
9
- s.date = %q{2009-08-25}
10
- s.default_executable = %q{glue}
11
- s.description = %q{Enables posting to GlueNow.com API service and reading posts from Glue accounts.}
12
- s.email = ["jordan.dobson@madebysquad.com"]
13
- s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt"]
14
- s.files = ["History.txt", "Manifest.txt", "README.txt", "Rakefile", "lib/glue.rb", "test/test_glue.rb"]
15
- s.homepage = %q{http://glue.rubyforge.org}
16
- s.post_install_message = %q{Get ready to Glue!}
17
- s.rdoc_options = ["--main", "README.txt"]
18
- s.require_paths = ["lib"]
19
- s.rubyforge_project = %q{glue}
20
- s.rubygems_version = %q{1.3.3}
21
- s.summary = %q{Enables posting to GlueNow.com API service and reading posts from Glue accounts.}
22
- s.test_files = ["test/test_glue.rb"]
23
-
24
- if s.respond_to? :specification_version then
25
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
26
- s.specification_version = 3
27
-
28
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
29
- s.add_runtime_dependency(%q<httparty>, [">= 0"])
30
- s.add_development_dependency(%q<mocha>, [">= 0"])
31
- s.add_development_dependency(%q<hoe>, [">= 1.12.2"])
32
- else
33
- s.add_dependency(%q<httparty>, [">= 0"])
34
- s.add_dependency(%q<mocha>, [">= 0"])
35
- s.add_dependency(%q<hoe>, [">= 1.12.2"])
36
- end
37
- else
38
- s.add_dependency(%q<httparty>, [">= 0"])
39
- s.add_dependency(%q<mocha>, [">= 0"])
40
- s.add_dependency(%q<hoe>, [">= 1.12.2"])
41
- end
42
- end