ki_youtrack 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/bin/ki_youtrack CHANGED
@@ -30,7 +30,7 @@ desc 'Get a issue'
30
30
  arg_name '[issue id]'
31
31
  command :issue do |c|
32
32
  c.action do |global_options, options, args|
33
- pretty = $stdout.tty?
33
+ pretty = true
34
34
 
35
35
  id = args.first
36
36
 
data/ki_youtrack.gemspec CHANGED
@@ -15,18 +15,18 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = KiYoutrack::VERSION
17
17
 
18
- gem.add_dependency('gli')
19
- gem.add_dependency('faraday')
20
- gem.add_dependency('faraday_middleware')
21
- gem.add_dependency('multi_xml')
22
- gem.add_dependency('multi_json')
23
- gem.add_dependency('highline')
18
+ gem.add_dependency('gli', '~> 1.6.0')
19
+ gem.add_dependency('faraday', '~> 0.8.2')
20
+ gem.add_dependency('faraday_middleware', '~> 0.8.8')
21
+ gem.add_dependency('multi_xml', '~> 0.4.1')
22
+ gem.add_dependency('multi_json', '~> 1.3.6')
23
+ gem.add_dependency('highline', '~> 1.6.8')
24
24
 
25
- gem.add_development_dependency('debugger')
26
- gem.add_development_dependency('rake')
27
- gem.add_development_dependency('rspec')
28
- gem.add_development_dependency('simplecov')
29
- gem.add_development_dependency('test-construct')
30
- gem.add_development_dependency('vcr')
31
- gem.add_development_dependency('webmock')
25
+ gem.add_development_dependency('debugger', '~> 1.2.0')
26
+ gem.add_development_dependency('rake', '~> 0.9.2')
27
+ gem.add_development_dependency('rspec', '~> 2.11.0')
28
+ gem.add_development_dependency('simplecov', '~> 0.6.4')
29
+ gem.add_development_dependency('test-construct', '~> 1.2.0')
30
+ gem.add_development_dependency('vcr', '~> 2.2.4')
31
+ gem.add_development_dependency('webmock', '~> 1.8.8')
32
32
  end
@@ -9,12 +9,12 @@ module KiYoutrack
9
9
  end
10
10
 
11
11
  def issue(id, opts = {})
12
- config.ensure_present(:login, :password, :subdomain, :ssl)
12
+ config.ensure_present('login', 'password', 'subdomain', 'ssl')
13
13
 
14
- login = @config.read(:login)
15
- password = @config.read(:password)
16
- subdomain = @config.read(:subdomain)
17
- ssl = @config.read(:ssl)
14
+ login = @config.read('login')
15
+ password = @config.read('password')
16
+ subdomain = @config.read('subdomain')
17
+ ssl = @config.read('ssl')
18
18
 
19
19
  session = Session.new(login, password, subdomain, :ssl => ssl)
20
20
  response = session.init
@@ -7,21 +7,16 @@ module KiYoutrack
7
7
 
8
8
  ui = HighLine.new
9
9
 
10
- $stdout.puts "Initializing config file at #{config.path}"
11
10
 
12
- old_subdomain = config.read(:subdomain)
13
- old_ssl = config.read(:ssl)
14
- old_login = config.read(:login)
15
- old_password = config.read(:password)
11
+ old_subdomain = config.read('subdomain')
12
+ old_ssl = config.read('ssl')
13
+ old_login = config.read('login')
14
+ old_password = config.read('password')
16
15
 
17
16
  subdomain = ui.ask("Subdomain: ") { |q| q.default = old_subdomain }
18
- convert_to_boolean = lambda do |string|
19
- return true if string.downcase == "true"
20
- return false if string.downcase == "false"
21
- string
22
- end
23
- ssl = ui.ask("SSL?: ", convert_to_boolean) do |q|
24
- q.default = old_ssl || "true";
17
+ ssl = ui.ask("Do you have a public or private YouTrack account?: ", ->(reply) { reply.downcase != 'public'} ) do |q|
18
+ # old_ssl can be nil in which case we want to fall back to SSL being ON.
19
+ q.default = (old_ssl == false) ? "public" : "private"
25
20
  q
26
21
  end
27
22
  login = ui.ask("Login (or email): ") { |q| q.default = old_login }
@@ -29,11 +24,12 @@ module KiYoutrack
29
24
  $stdout.puts "WARNING: Your YouTrack password will be written in plaintext to #{config.path}"
30
25
  password = ui.ask("Password: ") { |q| q.echo = "*" }
31
26
 
32
- config.write(:login, login)
33
- config.write(:password, password)
34
- config.write(:subdomain, subdomain)
35
- config.write(:ssl, ssl)
27
+ config.write('login', login)
28
+ config.write('password', password)
29
+ config.write('subdomain', subdomain)
30
+ config.write('ssl', ssl)
36
31
 
32
+ $stdout.puts "Initialized config file at #{config.path}"
37
33
  end
38
34
 
39
35
  end
@@ -12,8 +12,8 @@ module KiYoutrack
12
12
  # TODO - this should not know about the config here!
13
13
  # If filter needs data, it should be passed in!
14
14
  config = Kiseru::Config[:ki_youtrack]
15
- subdomain = config.read(:subdomain)
16
- ssl = config.read(:ssl)
15
+ subdomain = config.read('subdomain')
16
+ ssl = config.read('ssl')
17
17
  new_data['issue_url'] = Session.url(subdomain, ssl) + '/youtrack/issues/' + data['id']
18
18
  new_data['ki_type'] = 'youtrack_issue'
19
19
 
@@ -1,3 +1,3 @@
1
1
  module KiYoutrack
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -7,9 +7,9 @@ describe KiYoutrack::Session do
7
7
  # by doing 'ki_youtrack setup'
8
8
  config = Kiseru::ConfigDir.new(:root => SPEC_DIR,
9
9
  :name => SPEC_CONFIG_DIR).config(:ki_youtrack)
10
- @login = config.read(:login)
11
- @password = config.read(:password)
12
- @subdomain = config.read(:subdomain)
10
+ @login = config.read('login')
11
+ @password = config.read('password')
12
+ @subdomain = config.read('subdomain')
13
13
  end
14
14
 
15
15
  it "fails if credentials are not valid", :vcr do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ki_youtrack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,151 +10,151 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-08-15 00:00:00.000000000Z
13
+ date: 2012-08-17 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: gli
17
- requirement: &70195634193200 !ruby/object:Gem::Requirement
17
+ requirement: &70167975435080 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
- - - ! '>='
20
+ - - ~>
21
21
  - !ruby/object:Gem::Version
22
- version: '0'
22
+ version: 1.6.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70195634193200
25
+ version_requirements: *70167975435080
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: faraday
28
- requirement: &70195634192780 !ruby/object:Gem::Requirement
28
+ requirement: &70167975434580 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
- - - ! '>='
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 0.8.2
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70195634192780
36
+ version_requirements: *70167975434580
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: faraday_middleware
39
- requirement: &70195634192360 !ruby/object:Gem::Requirement
39
+ requirement: &70167975434120 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
- - - ! '>='
42
+ - - ~>
43
43
  - !ruby/object:Gem::Version
44
- version: '0'
44
+ version: 0.8.8
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70195634192360
47
+ version_requirements: *70167975434120
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: multi_xml
50
- requirement: &70195634191940 !ruby/object:Gem::Requirement
50
+ requirement: &70167975433660 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
- - - ! '>='
53
+ - - ~>
54
54
  - !ruby/object:Gem::Version
55
- version: '0'
55
+ version: 0.4.1
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *70195634191940
58
+ version_requirements: *70167975433660
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: multi_json
61
- requirement: &70195611982480 !ruby/object:Gem::Requirement
61
+ requirement: &70167975433200 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
- - - ! '>='
64
+ - - ~>
65
65
  - !ruby/object:Gem::Version
66
- version: '0'
66
+ version: 1.3.6
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *70195611982480
69
+ version_requirements: *70167975433200
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: highline
72
- requirement: &70195611982060 !ruby/object:Gem::Requirement
72
+ requirement: &70167975432740 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ! '>='
75
+ - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: '0'
77
+ version: 1.6.8
78
78
  type: :runtime
79
79
  prerelease: false
80
- version_requirements: *70195611982060
80
+ version_requirements: *70167975432740
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: debugger
83
- requirement: &70195611981640 !ruby/object:Gem::Requirement
83
+ requirement: &70167975432280 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
- - - ! '>='
86
+ - - ~>
87
87
  - !ruby/object:Gem::Version
88
- version: '0'
88
+ version: 1.2.0
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *70195611981640
91
+ version_requirements: *70167975432280
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: rake
94
- requirement: &70195611981220 !ruby/object:Gem::Requirement
94
+ requirement: &70167975431820 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
- - - ! '>='
97
+ - - ~>
98
98
  - !ruby/object:Gem::Version
99
- version: '0'
99
+ version: 0.9.2
100
100
  type: :development
101
101
  prerelease: false
102
- version_requirements: *70195611981220
102
+ version_requirements: *70167975431820
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rspec
105
- requirement: &70195611980800 !ruby/object:Gem::Requirement
105
+ requirement: &70167975431360 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
- - - ! '>='
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: 2.11.0
111
111
  type: :development
112
112
  prerelease: false
113
- version_requirements: *70195611980800
113
+ version_requirements: *70167975431360
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: simplecov
116
- requirement: &70195611980380 !ruby/object:Gem::Requirement
116
+ requirement: &70167975430900 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
- - - ! '>='
119
+ - - ~>
120
120
  - !ruby/object:Gem::Version
121
- version: '0'
121
+ version: 0.6.4
122
122
  type: :development
123
123
  prerelease: false
124
- version_requirements: *70195611980380
124
+ version_requirements: *70167975430900
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: test-construct
127
- requirement: &70195611979960 !ruby/object:Gem::Requirement
127
+ requirement: &70167975430440 !ruby/object:Gem::Requirement
128
128
  none: false
129
129
  requirements:
130
- - - ! '>='
130
+ - - ~>
131
131
  - !ruby/object:Gem::Version
132
- version: '0'
132
+ version: 1.2.0
133
133
  type: :development
134
134
  prerelease: false
135
- version_requirements: *70195611979960
135
+ version_requirements: *70167975430440
136
136
  - !ruby/object:Gem::Dependency
137
137
  name: vcr
138
- requirement: &70195611979540 !ruby/object:Gem::Requirement
138
+ requirement: &70167975429980 !ruby/object:Gem::Requirement
139
139
  none: false
140
140
  requirements:
141
- - - ! '>='
141
+ - - ~>
142
142
  - !ruby/object:Gem::Version
143
- version: '0'
143
+ version: 2.2.4
144
144
  type: :development
145
145
  prerelease: false
146
- version_requirements: *70195611979540
146
+ version_requirements: *70167975429980
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: webmock
149
- requirement: &70195611979120 !ruby/object:Gem::Requirement
149
+ requirement: &70167975429520 !ruby/object:Gem::Requirement
150
150
  none: false
151
151
  requirements:
152
- - - ! '>='
152
+ - - ~>
153
153
  - !ruby/object:Gem::Version
154
- version: '0'
154
+ version: 1.8.8
155
155
  type: :development
156
156
  prerelease: false
157
- version_requirements: *70195611979120
157
+ version_requirements: *70167975429520
158
158
  description: Kiseru YouTrack client
159
159
  email:
160
160
  - ben@freeagent.com