khronos 0.0.3.pre2 → 0.0.3.pre3

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,18 @@
1
+ Copyright (c) 2012 Endel Dreyer
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7
+ the Software, and to permit persons to whom the Software is furnished to do so,
8
+ subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,10 @@
1
+ khronos
2
+ ===
3
+
4
+ Job scheduling for the cloud.
5
+
6
+
7
+ License
8
+ ---
9
+
10
+ Khronos is released under the MIT license. Please read the LICENSE file.
@@ -39,7 +39,7 @@ module Khronos
39
39
  url = "http://#{Config.instance.scheduler['host']}"
40
40
  url += ":#{Config.instance.scheduler['port']}" if Config.instance.scheduler['port']
41
41
  url += "/task"
42
- RestClient.patch(url, :id => schedule['id'])
42
+ RestClient.put(url, :id => schedule['id'], :patch => true)
43
43
  end
44
44
 
45
45
  end
@@ -82,7 +82,16 @@ module Khronos
82
82
  # No schedule found for this params.
83
83
  return {}.to_json unless schedule
84
84
 
85
- schedule.update_attributes(params)
85
+ if params['patch']
86
+ # When recurrency check requested
87
+ if schedule.recurrency > 0
88
+ schedule.at += schedule.recurrency
89
+ schedule.active = true
90
+ end
91
+ else
92
+ # When put requested
93
+ schedule.update_attributes(params)
94
+ end
86
95
  schedule.save
87
96
 
88
97
  schedule.to_json
@@ -94,19 +103,6 @@ module Khronos
94
103
  #
95
104
  # @return [Hash] data
96
105
  patch '/task' do
97
- schedule = Storage::Schedule.where(params).first
98
-
99
- # No schedule found for this params.
100
- return {}.to_json unless schedule
101
-
102
- # Is recurrency check requested
103
- if schedule.recurrency > 0
104
- schedule.at += schedule.recurrency
105
- schedule.active = true
106
- end
107
- schedule.save
108
-
109
- schedule.to_json
110
106
  end
111
107
 
112
108
  # Force a task to be scheduled right now
@@ -1,3 +1,3 @@
1
1
  module Khronos
2
- VERSION = '0.0.3.pre2'
2
+ VERSION = '0.0.3.pre3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: khronos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.pre2
4
+ version: 0.0.3.pre3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -183,6 +183,8 @@ files:
183
183
  - .rspec
184
184
  - .travis.yml
185
185
  - Gemfile
186
+ - LICENSE
187
+ - README.md
186
188
  - Rakefile
187
189
  - bin/khronos
188
190
  - config.ru