acuforce 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.3.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{acuforce}
8
- s.version = "0.2.3"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Harrison Strowd"]
12
- s.date = %q{2011-12-24}
12
+ s.date = %q{2012-01-20}
13
13
  s.description = %q{
14
14
  Provides an API for the following actions:
15
15
  * Logging in and Logging out
@@ -6,7 +6,6 @@ require 'singleton'
6
6
  class AcunoteConnection
7
7
  include Singleton
8
8
 
9
- attr_accessor :username
10
9
  attr_writer :home_url
11
10
  attr_reader :logged_in, :mech
12
11
 
@@ -35,17 +34,22 @@ class AcunoteConnection
35
34
  "#{self.home_url}/login/logout"
36
35
  end
37
36
 
37
+ def load_session
38
+ if File.exists?(SESSION_FILE) && ! File.zero?(SESSION_FILE) && mech.cookie_jar.load(SESSION_FILE)
39
+ @logged_in = true
40
+ end
41
+ end
42
+
43
+ def clear_session
44
+ File.delete(SESSION_FILE) if File.exists?(SESSION_FILE)
45
+ end
46
+
38
47
  def login(username, password, force = false)
39
48
  @logged_in = nil if force
40
49
  return true if logged_in
41
-
42
- #Going to assume the session is good to save time here. The session will be
43
- #discarded and a force login will be performed if get_page fails.
44
- if !force && File.exists?(SESSION_FILE) && ! File.zero?(SESSION_FILE) && mech.cookie_jar.load(SESSION_FILE)
45
- STDERR.puts "Loaded session file" if DEBUG
46
- @username = username
47
- @logged_in = true
48
- end
50
+
51
+ # Try to load an existing session.
52
+ load_session unless force
49
53
 
50
54
  unless logged_in
51
55
 
@@ -66,7 +70,6 @@ class AcunoteConnection
66
70
 
67
71
  #serialize session and save for later reuse
68
72
  mech.cookie_jar.save_as(SESSION_FILE)
69
- @username = username
70
73
  @logged_in = true
71
74
  end
72
75
  true
@@ -77,7 +80,6 @@ class AcunoteConnection
77
80
  File.delete(SESSION_FILE)
78
81
  end
79
82
  get_page(logout_url)
80
- @username = nil
81
83
  @logged_in = false
82
84
  end
83
85
 
@@ -2,8 +2,6 @@ require 'acunote_connection'
2
2
 
3
3
  # API for accessing Acunote projects.
4
4
  class AcunoteSprint
5
- ACUNOTE_CSV_HEADER = "Level,Number,Description,Tags,Owner,Status,Resolution,Priority,Severity,Estimate,Remaining,Due Date,QA Owner,Business Owner,Wiki,Watchers,Related,Duplicate,Predecessors,Successors,Version 1\r\n" unless defined? ACUNOTE_CSV_HEADER
6
-
7
5
  def self.acu_conn
8
6
  AcunoteConnection.instance
9
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acuforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-24 00:00:00.000000000 -06:00
12
+ date: 2012-01-20 00:00:00.000000000 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mechanize
17
- requirement: &2173148640 !ruby/object:Gem::Requirement
17
+ requirement: &2173490020 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2173148640
25
+ version_requirements: *2173490020
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
- requirement: &2173148160 !ruby/object:Gem::Requirement
28
+ requirement: &2173489540 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 2.3.0
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2173148160
36
+ version_requirements: *2173489540
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: bundler
39
- requirement: &2173147680 !ruby/object:Gem::Requirement
39
+ requirement: &2173489060 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.0.0
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2173147680
47
+ version_requirements: *2173489060
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: jeweler
50
- requirement: &2173163560 !ruby/object:Gem::Requirement
50
+ requirement: &2173488580 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 1.6.4
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *2173163560
58
+ version_requirements: *2173488580
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rcov
61
- requirement: &2173163080 !ruby/object:Gem::Requirement
61
+ requirement: &2173505220 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,7 +66,7 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *2173163080
69
+ version_requirements: *2173505220
70
70
  description: ! '
71
71
 
72
72
  Provides an API for the following actions:
@@ -117,7 +117,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  segments:
119
119
  - 0
120
- hash: -4410214918225704994
120
+ hash: 393877045666801415
121
121
  required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  none: false
123
123
  requirements: