synrp 0.16.4.1 → 0.16.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/synrp/cli.rb CHANGED
@@ -51,7 +51,7 @@ end
51
51
  project_id = synRP.find_project_id_by_project_name(opts[:project]) || opts[:project]
52
52
  person_id = synRP.find_person_id_by_displayname(opts[:person]) || opts[:person]
53
53
 
54
- synRP.request_res(opts[:kw], project_id, person_id, opts[:minutes], opts[:comment])
54
+ synRP.request_res(opts[:kw], project_id, person_id, opts[:minutes], opts[:comment], opts[:username])
55
55
  end
56
56
  end
57
57
 
@@ -146,7 +146,7 @@ end
146
146
  synRP.get_availabilities(opts[:kw]).each do |person_id, minutes|
147
147
  person = all_persons.find {|p| p["id"] == person_id.to_i }
148
148
  if minutes > 0 && person["visible"]
149
- synRP.request_res(opts[:kw], project_id, person_id, 120, 'Default Meta')
149
+ synRP.request_res(opts[:kw], project_id, person_id, 120, 'Default Meta', opts[:username])
150
150
  end
151
151
  end
152
152
  end
data/lib/synrp/synrp.rb CHANGED
@@ -10,6 +10,7 @@
10
10
  require 'net/http'
11
11
  require 'json'
12
12
  require 'yaml'
13
+ require 'highline/import'
13
14
 
14
15
  module Synrp
15
16
  class SynRP
@@ -24,6 +25,8 @@ class SynRP
24
25
  unless opts[r_opt]
25
26
  if config_opts[r_opt.to_s]
26
27
  opts[r_opt] = config_opts[r_opt.to_s]
28
+ elsif r_opt == :password
29
+ opts[:password] = ask("Enter Password: ") {|q| q.echo = "*"}
27
30
  else
28
31
  $stderr.puts "--#{r_opt} option is required"
29
32
  exit 1
@@ -121,9 +124,10 @@ class SynRP
121
124
  sum
122
125
  end
123
126
 
124
- def request_res(yearWeek, project, person, minutes, comment='')
125
- puts "Requesting yearWeek=#{yearWeek}&project=#{project}&person=#{person}&minutes=#{minutes}&comment=#{comment}"
126
- $conn.post("/web/allocation-requests/", "yearWeek=#{yearWeek}&project=#{project}&person=#{person}&minutes=#{minutes}&comment=#{comment}", $headers)
127
+ def request_res(yearWeek, project, person, minutes, comment='', username='synrp cli')
128
+ params = "yearWeek=#{yearWeek}&project=#{project}&person=#{person}&minutes=#{minutes}&comment=#{comment}&by=#{username}"
129
+ puts "Requesting #{params}"
130
+ $conn.post("/web/allocation-requests/", params, $headers)
127
131
  end
128
132
 
129
133
  end
data/lib/synrp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Synrp
2
- VERSION = "0.16.4.1"
2
+ VERSION = "0.16.6"
3
3
  end
data/synrp.gemspec CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
19
19
 
20
20
  s.add_runtime_dependency "cri", '~> 2.2'
21
21
  s.add_runtime_dependency "json"
22
+ s.add_runtime_dependency "highline"
22
23
 
23
24
  s.post_install_message = %q{------------------------------------------------------------------------------
24
25
  run "synrp help" for usage information
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synrp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 221
4
+ hash: 83
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 16
9
- - 4
10
- - 1
11
- version: 0.16.4.1
9
+ - 6
10
+ version: 0.16.6
12
11
  platform: ruby
13
12
  authors:
14
13
  - Fabian Buch
@@ -16,7 +15,7 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2012-04-11 00:00:00 Z
18
+ date: 2012-04-12 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: cri
@@ -47,6 +46,20 @@ dependencies:
47
46
  version: "0"
48
47
  type: :runtime
49
48
  version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: highline
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ type: :runtime
62
+ version_requirements: *id003
50
63
  description: The synyx Resource Planner is a web application for managing work assignments. See https://github.com/Synyx/synRP for more information. This is a commandline client that uses its REST service.
51
64
  email:
52
65
  - buch@synyx.de