winever 0.1.5 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: abb79d85456c50d28ef9d0edbb5d717f6936fe757de36db983d20caa83979507
4
+ data.tar.gz: 2f365cbb90d5d76f78f882a0105ea3bad3c77253adf241eca637f5589d5bbc5a
5
+ SHA512:
6
+ metadata.gz: 509da6d8433f62e0df1588aace2e139bfdde7fc88af6975d0ad323fc5d10241ffcbc278bf4ab0f7f765d623acb85879d9dd672b42082c2fefaf971ebe0d239a6
7
+ data.tar.gz: 4815f7a3ff92860bb6a2f1e3db076a26e54f49f10d4c0b1f5a829eff499994e81b6e3e8d1c511561e8e0df27c313defe682b97530a786107738a341fad0862cc
@@ -42,7 +42,7 @@ module Winever
42
42
  @options[:cut] ||= 0
43
43
  @options[:identifier] ||= default_identifier
44
44
 
45
- unless File.exists?(@options[:file])
45
+ unless File.exist?(@options[:file])
46
46
  warn("[fail] Can't find file: #{@options[:file]}")
47
47
  exit(1)
48
48
  end
@@ -32,21 +32,21 @@ module Winever
32
32
  end
33
33
 
34
34
  def password
35
+ return @options[:password] if @options.has_key?(:password)
36
+ return ENV['WINEVER_PASSWORD'] if ENV['WINEVER_PASSWORD'] && !ENV['WINEVER_PASSWORD'].empty?
37
+
35
38
  return @password.empty? ? nil : @password if @password
36
39
  require 'highline/import'
37
40
  prompt = <<-PRMP.gsub(/^ +/, '')
38
- To setup tasks correctly, the password of the current user account is needed.
39
- You can leave it empty, but without the password, the task will only be run the user is logged on and will open a black
40
- console window while running.
41
- You can manually go edit the scheduled task to add the password manually if you prefer not to give it to Winever, but you will need to go do that every time you edit the tasks through Winever, for each task.
42
- Enter the password of the current user (or just press enter to skip):
41
+ To setup tasks, the password of the current user account is needed.
42
+ Enter the password of the current windows user (or leave blank to avoid doing the changes):
43
43
  PRMP
44
44
 
45
45
  pw = ask(prompt){|q| q.echo = false}
46
46
  while pw && !pw.empty? && !validate_password(pw)
47
47
  prompt = <<-PRMP.gsub(/^ +/, '')
48
48
  Invalid password entered.
49
- Enter the password of the current user (or just press enter to skip):
49
+ Enter the password of the current windows user (or leave blank to avoid doing the changes):
50
50
  PRMP
51
51
  pw = ask(prompt){|q| q.echo = false}
52
52
  end
@@ -62,6 +62,8 @@ module Winever
62
62
  end
63
63
 
64
64
  def create_tasks
65
+ return if self.password.nil?
66
+
65
67
  cron_entries = Winever::WheneverInterface.valid_cron_entries(@options)
66
68
 
67
69
  created_task_names = []
@@ -72,8 +74,12 @@ module Winever
72
74
  end
73
75
 
74
76
  def update_tasks
77
+ return false if self.password.nil?
78
+
75
79
  task_names = create_tasks
76
80
  clear_tasks_except(task_names)
81
+
82
+ true
77
83
  end
78
84
 
79
85
  def clear_tasks_except keep_tasks=[]
@@ -87,6 +93,8 @@ module Winever
87
93
  end
88
94
 
89
95
  def create_task cron_entry
96
+ return if self.password.nil?
97
+
90
98
  task_name = generate_task_name(cron_entry.task_name)
91
99
 
92
100
  # Replacing the /dev/null by NUL
@@ -1,3 +1,3 @@
1
1
  module Winever
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,110 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winever
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
5
- prerelease:
4
+ version: 0.1.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Maxime Handfield Lapointe
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2015-07-06 00:00:00.000000000 Z
11
+ date: 2023-12-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: whenever
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.9.1
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 0.9.1
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: highline
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: 0.5.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: 0.5.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: win32-taskscheduler
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: 0.3.1
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: 0.3.1
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: bundler
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ~>
59
+ - - "~>"
68
60
  - !ruby/object:Gem::Version
69
61
  version: '1.3'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ~>
66
+ - - "~>"
76
67
  - !ruby/object:Gem::Version
77
68
  version: '1.3'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rake
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: minitest
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  description: Clean ruby syntax for writing and deploying tasks in Windows' task scheduler.
@@ -116,7 +103,7 @@ executables:
116
103
  extensions: []
117
104
  extra_rdoc_files: []
118
105
  files:
119
- - .gitignore
106
+ - ".gitignore"
120
107
  - Gemfile
121
108
  - LICENSE.txt
122
109
  - README.md
@@ -136,33 +123,25 @@ files:
136
123
  homepage: ''
137
124
  licenses:
138
125
  - MIT
126
+ metadata: {}
139
127
  post_install_message:
140
128
  rdoc_options: []
141
129
  require_paths:
142
130
  - lib
143
131
  required_ruby_version: !ruby/object:Gem::Requirement
144
- none: false
145
132
  requirements:
146
- - - ! '>='
133
+ - - ">="
147
134
  - !ruby/object:Gem::Version
148
135
  version: '0'
149
- segments:
150
- - 0
151
- hash: 1699128231675029553
152
136
  required_rubygems_version: !ruby/object:Gem::Requirement
153
- none: false
154
137
  requirements:
155
- - - ! '>='
138
+ - - ">="
156
139
  - !ruby/object:Gem::Version
157
140
  version: '0'
158
- segments:
159
- - 0
160
- hash: 1699128231675029553
161
141
  requirements: []
162
- rubyforge_project:
163
- rubygems_version: 1.8.25
142
+ rubygems_version: 3.4.10
164
143
  signing_key:
165
- specification_version: 3
144
+ specification_version: 4
166
145
  summary: Add tasks in Windows' task scheduler from a ruby configuration file.
167
146
  test_files:
168
147
  - test/test_helper.rb