ruby-fogbugz 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -48,13 +48,29 @@ As you see, `ruby-fogbugz` is without magic and leaves most to the user.
48
48
  All Fogbugz API requests require a token. Thus `#authenticate` must be called on the `ruby-fogbugz` instance before `#command`'s are sent:
49
49
 
50
50
  ```ruby
51
- require 'rubygems'
52
51
  require 'fogbugz'
53
- require 'pp'
54
52
 
55
53
  fogbugz = Fogbugz::Interface.new(:email => 'my@email.com', :password => 'seekrit', :uri => 'https://company.fogbugz.com') # remember to use https!
56
- fogbugz.authenticate # token is not automatically attached to every future requests
57
- pp fogbugz.command(:listPeople)
54
+ fogbugz.authenticate # token is now automatically attached to every future requests
55
+ p fogbugz.command(:listPeople)
56
+ ```
57
+
58
+ `#authenticate` fetches a new token every time. To avoid the extra request,
59
+ obtain a token:
60
+
61
+ ```ruby
62
+ require 'fogbugz'
63
+
64
+ fogbugz = Fogbugz::Interface.new(:email => 'my@email.com', :password => 'seekrit', :uri => 'https://company.fogbugz.com') # remember to use https!
65
+ fogbugz.authenticate # token is now automatically attached to every future requests
66
+
67
+ puts "Token: #{fogbugz.token}"
68
+ ```
69
+
70
+ Run the script, and initialize with the returned token:
71
+
72
+ ```ruby
73
+ fogbugz = Fogbugz::Interface.new(:token => "some token to use from now on", :email => 'my@email.com', :password => 'seekrit', :uri => 'https://company.fogbugz.com') # remember to use https!
58
74
  ```
59
75
 
60
76
  [fad]:http://fogbugz.stackexchange.com/fogbugz-xml-api
@@ -9,6 +9,7 @@ module Fogbugz
9
9
  @options = {}.merge(options)
10
10
 
11
11
  raise InitializationError, "Must supply URI (e.g. https://fogbugz.company.com)" unless options[:uri]
12
+ @token = options[:token] if options[:token]
12
13
  @http = Fogbugz.adapter[:http].new(:uri => options[:uri])
13
14
  @xml = Fogbugz.adapter[:xml]
14
15
  end
@@ -1,3 +1,3 @@
1
1
  module Fogbugz
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-fogbugz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-27 00:00:00.000000000 Z
12
+ date: 2012-03-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: crack
16
- requirement: &70263146086620 !ruby/object:Gem::Requirement
16
+ requirement: &70156701468460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70263146086620
24
+ version_requirements: *70156701468460
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: minitest
27
- requirement: &70263146102500 !ruby/object:Gem::Requirement
27
+ requirement: &70156701467680 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70263146102500
35
+ version_requirements: *70156701467680
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: mocha
38
- requirement: &70263146101820 !ruby/object:Gem::Requirement
38
+ requirement: &70156701466740 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70263146101820
46
+ version_requirements: *70156701466740
47
47
  description: A simple Ruby wrapper for the Fogbugz XML API
48
48
  email:
49
49
  - sirup@sirupsen.com