simplews 1.3.2 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Miguel Vazquez
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc CHANGED
@@ -1,92 +1,18 @@
1
- = simpleWS
1
+ = simplews
2
2
 
3
- == DESCRIPTION:
3
+ Description goes here.
4
4
 
5
- This defines a class that can simplifies creating Web Services. It inherits from soap2r's
6
- SOAP::RPC::StandaloneServer and provides a few enhancements, the most important the fact that
7
- it is able to produce the WSDL automatically.
5
+ == Note on Patches/Pull Requests
6
+
7
+ * Fork the project.
8
+ * Make your feature addition or bug fix.
9
+ * Add tests for it. This is important so I don't break it in a
10
+ future version unintentionally.
11
+ * Commit, do not mess with rakefile, version, or history.
12
+ (if you want to have your own version, that is fine but
13
+ bump version in a commit by itself I can ignore when I pull)
14
+ * Send me a pull request. Bonus points for topic branches.
8
15
 
9
- == FEATURES/PROBLEMS:
16
+ == Copyright
10
17
 
11
-
12
- == SYNOPSIS:
13
-
14
- Each Web Service provided is described using the method 'serve', which takes
15
- as arguments the name of the service, the name of its arguments, the type of
16
- its arguments and an optional block of code. If a block of code is provided,
17
- it will be the one executed when the service is called, if not, a function
18
- with the same name will be used. The types for the arguments are listed here,
19
- along with the WSDL type that it is translated to:
20
-
21
- :string => 'xsd:string',
22
- :integer => 'xsd:integer',
23
- :array => 'tns:ArrayOfString',
24
- :hash => 'tns:Map',
25
- :binary => 'xsd:base64Binary',
26
-
27
- The type of the result value may also be specified using the name :return,
28
- this means no argument may be called :return. If it is not specified there
29
- will be no return value.
30
-
31
- Following is an example of use:
32
-
33
- class TestWS < SimpleWS
34
- def hi(name)
35
- "Hi #{name}, how are you?"
36
- end
37
-
38
- def initialize(*args)
39
- super(*args)
40
- serve :hi, %(name), :name => :string, :return => :string
41
-
42
- serve :bye, %(name), :name => :string, :return => :string do |name
43
- "Bye bye #{name}. See you soon."
44
- end
45
- end
46
- end
47
-
48
- The constructor accepts a number of parameters. The name of the server, a
49
- description, the host and the port, along with any other arguments one wishes
50
- to pass to the SOAP::RPC::StandaloneServer constructor
51
-
52
- This is an example of instantiating the above server:
53
-
54
- server = TestWS.new("TestWS", "Greeting Services", 'localhost', '1984')
55
- server.wsdl("TestWS.wsdl")
56
-
57
- The function 'wsdl' saves the WSDL describing the services and the location
58
- provided as an argument.
59
-
60
-
61
- == REQUIREMENTS:
62
-
63
- Requires soap4r gem to be installed.
64
-
65
- == INSTALL:
66
-
67
- sudo gem install simpleWS
68
-
69
- == LICENSE:
70
-
71
- (The MIT License)
72
-
73
- Copyright (c) 2008 Miguel Vazquez (miguel.vazquez@fdi.ucm.es)
74
-
75
- Permission is hereby granted, free of charge, to any person obtaining
76
- a copy of this software and associated documentation files (the
77
- 'Software'), to deal in the Software without restriction, including
78
- without limitation the rights to use, copy, modify, merge, publish,
79
- distribute, sublicense, and/or sell copies of the Software, and to
80
- permit persons to whom the Software is furnished to do so, subject to
81
- the following conditions:
82
-
83
- The above copyright notice and this permission notice shall be
84
- included in all copies or substantial portions of the Software.
85
-
86
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
87
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
88
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
89
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
90
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
91
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
92
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
+ Copyright (c) 2009 Miguel Vazquez. See LICENSE for details.
data/lib/simplews/jobs.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require File.join(File.dirname(File.dirname(__FILE__)) + '/simplews')
2
2
 
3
3
  require 'yaml'
4
- require 'drb'
5
4
  require 'singleton'
6
5
  require 'rand'
7
6
  require 'zlib'
@@ -14,8 +13,13 @@ class SimpleWS::Jobs < SimpleWS
14
13
  class Aborted < Exception; end
15
14
 
16
15
 
17
- #{{{ Scheduler
16
+ SLEEP_TIMES = {
17
+ :job_info => 1,
18
+ :monitor => 2,
19
+ }
20
+
18
21
 
22
+ #{{{ Scheduler
19
23
  module Scheduler
20
24
  include Process
21
25
 
@@ -26,7 +30,8 @@ class SimpleWS::Jobs < SimpleWS
26
30
 
27
31
  @@queue = []
28
32
  @@max_jobs = 3
29
-
33
+
34
+
30
35
  def self.random_name(s="", num=20)
31
36
  num.times{
32
37
  r = rand
@@ -44,17 +49,18 @@ class SimpleWS::Jobs < SimpleWS
44
49
  def self.make_name(name = "")
45
50
  name = Scheduler::random_name("job-") unless name =~ /\w/
46
51
 
47
- taken = @@names.select{|n| n =~ /^#{ name }(-\d+)?$/}
52
+ taken = @@names.select{|n| n =~ /^#{ Regexp.quote name }(?:-\d+)?$/}
48
53
  taken += Job.taken(name)
49
54
  taken = taken.sort.uniq
50
55
  if taken.any?
51
56
  if taken.length == 1
52
- return name + '-1'
57
+ return name + '-2'
53
58
  else
54
59
  last = taken.collect{|s|
55
60
  if s.match(/-(\d+)$/)
56
61
  $1.to_i
57
- else 0
62
+ else
63
+ 1
58
64
  end
59
65
  }.sort.last
60
66
  return name + '-' + (last + 1).to_s
@@ -78,10 +84,11 @@ class SimpleWS::Jobs < SimpleWS
78
84
  end
79
85
 
80
86
  def self.dequeue
81
- if @@pids.length < @@max_jobs && @@queue.any?
87
+ if @@pids.length <= @@max_jobs && @@queue.any?
82
88
  job_info = @@queue.pop
83
89
 
84
90
  pid = Job.new.run(job_info[:task], job_info[:name], @@task_results[job_info[:task]], *job_info[:args])
91
+
85
92
  @@pids[job_info[:name]] = pid
86
93
  pid
87
94
  else
@@ -89,6 +96,10 @@ class SimpleWS::Jobs < SimpleWS
89
96
  end
90
97
  end
91
98
 
99
+ def self.queue
100
+ @@queue
101
+ end
102
+
92
103
  def self.run(task, *args)
93
104
  suggested_name = *args.pop
94
105
  name = make_name(suggested_name)
@@ -107,7 +118,9 @@ class SimpleWS::Jobs < SimpleWS
107
118
  end
108
119
 
109
120
  def self.clean_job(pid)
110
- name = @@pids.select{|name, p| p == pid}.first[0]
121
+ name = @@pids.select{|name, p| p == pid}.first
122
+ return if name.nil?
123
+ name = name.first
111
124
  puts "Process #{ name } with pid #{ pid } finished with exitstatus #{$?.exitstatus}"
112
125
  state = Job.job_info(name)
113
126
  if ![:error, :done, :aborted].include?(state[:status])
@@ -121,18 +134,27 @@ class SimpleWS::Jobs < SimpleWS
121
134
  def self.job_monitor
122
135
  Thread.new{
123
136
  while true
124
- pid = dequeue
125
- if pid
126
- Thread.new(pid){|pid|
127
- begin
128
- pid = Process.wait(-1,Process::WUNTRACED) if @@pids.any?
129
- clean_job(pid) if @@pids.values.include? pid
130
- rescue Exception
131
- puts $!.message
137
+ begin
138
+ pid = dequeue
139
+ if pid.nil?
140
+ if @@pids.any?
141
+ pid_exit = Process.wait(-1, Process::WNOHANG)
142
+ if pid_exit
143
+ clean_job(pid_exit)
144
+ else
145
+ sleep SimpleWS::Jobs::SLEEP_TIMES[:monitor]
146
+ end
147
+ else
148
+ sleep SimpleWS::Jobs::SLEEP_TIMES[:monitor]
132
149
  end
133
- }
150
+ else
151
+ sleep SimpleWS::Jobs::SLEEP_TIMES[:monitor]
152
+ end
153
+ rescue
154
+ puts $!.message
155
+ puts $!.backtrace.join("\n")
156
+ sleep 2
134
157
  end
135
- sleep 2
136
158
  end
137
159
  }
138
160
  end
@@ -170,7 +192,8 @@ class SimpleWS::Jobs < SimpleWS
170
192
  end
171
193
 
172
194
  def self.taken(name = "")
173
- Dir.glob(@@savedir + "/#{ name }*.marshal").collect{|n| n.match(/(#{ name }.*).marshal/)[1]}
195
+ Dir.glob(@@savedir + "/#{ name }*.marshal").
196
+ collect{|n| n.match(/\/(#{ Regexp.quote name }(?:-\d+)?).marshal/); $1}.compact
174
197
  end
175
198
  def self.path(file, name)
176
199
  if file =~ /^\/|#{@@workdir}/
@@ -196,7 +219,7 @@ class SimpleWS::Jobs < SimpleWS
196
219
  rescue Exception
197
220
  if retries > 0
198
221
  retries -= 1
199
- sleep 1
222
+ sleep SimpleWS::Jobs::SLEEP_TIMES[:job_info]
200
223
  retry
201
224
  end
202
225
  info = nil
@@ -204,6 +227,11 @@ class SimpleWS::Jobs < SimpleWS
204
227
 
205
228
  raise JobNotFound, "Job with name '#{ name }' was not found" if info.nil?
206
229
 
230
+ if info[:queued] && !@@queue.collect{|info| info[:name]}.include?(name)
231
+ FileUtils.rm(File.join(@@savedir, name + '.marshal'))
232
+ raise Aborted, "Job #{ name } has been removed from the queue"
233
+ end
234
+
207
235
  info
208
236
  end
209
237
 
@@ -304,6 +332,8 @@ class SimpleWS::Jobs < SimpleWS
304
332
  puts $!.message
305
333
  puts $!.backtrace
306
334
  exit(-1)
335
+ else
336
+ exit($!.status)
307
337
  end
308
338
  end
309
339
  end
@@ -364,6 +394,10 @@ class SimpleWS::Jobs < SimpleWS
364
394
  end
365
395
  }
366
396
 
397
+ serve :queue, [], :return => :array do
398
+ Scheduler.queue.collect{|info| info[:name]}
399
+ end
400
+
367
401
  serve :status, ['job'], :job => :string, :return => :string do |job|
368
402
  Scheduler.job_info(job)[:status].to_s
369
403
  end
data/lib/simplews.rb CHANGED
@@ -44,7 +44,7 @@ require 'builder'
44
44
 
45
45
 
46
46
  class SimpleWS < SOAP::RPC::StandaloneServer
47
- VERSION = "1.3.2"
47
+ VERSION = "1.3.6"
48
48
 
49
49
 
50
50
  # This is a helper function for clients. Given the +url+ where the
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplews
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
@@ -9,75 +9,50 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-17 00:00:00 +02:00
12
+ date: 2009-10-29 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: newgem
17
- type: :development
16
+ name: rand
17
+ type: :runtime
18
18
  version_requirement:
19
19
  version_requirements: !ruby/object:Gem::Requirement
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.2.3
23
+ version: "0"
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
- name: hoe
27
- type: :development
26
+ name: builder
27
+ type: :runtime
28
28
  version_requirement:
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.8.0
33
+ version: "0"
34
34
  version:
35
- description: This defines a class that can simplifies creating Web Services. It inherits from soap2r's SOAP::RPC::StandaloneServer and provides a few enhancements, the most important the fact that it is able to produce the WSDL automatically.
36
- email:
37
- - mikisvaz@yahoo.com
35
+ description: Generates WSDL automatically. It manages jobs as asynchronous processes
36
+ email: miguel.vazquez@fdi.ucm.es
38
37
  executables: []
39
38
 
40
39
  extensions: []
41
40
 
42
41
  extra_rdoc_files:
43
- - History.txt
44
- - Manifest.txt
45
- - PostInstall.txt
42
+ - LICENSE
46
43
  - README.rdoc
47
- - website/index.txt
48
44
  files:
49
- - History.txt
50
- - Manifest.txt
51
- - PostInstall.txt
52
- - README.rdoc
53
- - Rakefile
54
- - config/hoe.rb
55
- - config/requirements.rb
56
45
  - lib/simplews.rb
57
46
  - lib/simplews/jobs.rb
58
- - script/console
59
- - script/destroy
60
- - script/generate
61
- - script/txt2html
62
- - setup.rb
63
- - simplews.gemspec
64
- - tasks/deployment.rake
65
- - tasks/environment.rake
66
- - tasks/website.rake
67
- - test/simplews/test_jobs.rb
68
- - test/test_helper.rb
69
- - test/test_simplews.rb
70
- - website/index.html
71
- - website/index.txt
72
- - website/javascripts/rounded_corners_lite.inc.js
73
- - website/stylesheets/screen.css
74
- - website/template.html.erb
47
+ - LICENSE
48
+ - README.rdoc
75
49
  has_rdoc: true
76
- homepage:
77
- post_install_message: PostInstall.txt
50
+ homepage: http://github.com/mikisvaz/simplews
51
+ licenses: []
52
+
53
+ post_install_message:
78
54
  rdoc_options:
79
- - --main
80
- - README.rdoc
55
+ - --charset=UTF-8
81
56
  require_paths:
82
57
  - lib
83
58
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -94,12 +69,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
69
  version:
95
70
  requirements: []
96
71
 
97
- rubyforge_project: simplews
98
- rubygems_version: 1.3.1
72
+ rubyforge_project:
73
+ rubygems_version: 1.3.5
99
74
  signing_key:
100
- specification_version: 2
101
- summary: This defines a class that can simplifies creating Web Services
102
- test_files:
103
- - test/test_simplews.rb
104
- - test/test_helper.rb
105
- - test/simplews/test_jobs.rb
75
+ specification_version: 3
76
+ summary: Simplifies creating soap4r web services as stand-alone servers
77
+ test_files: []
78
+
data/History.txt DELETED
@@ -1,57 +0,0 @@
1
- == 1.3.2 2009-03-21
2
-
3
- == 1.3.1 2008-12-20
4
-
5
- * 1 minor enhancement:
6
- * Use Marshal instead of YAML, it seems faster...
7
-
8
- * 1 mayor enhancement:
9
- * Removed old versions of job based servers
10
-
11
- == 1.3.0 2008-12-20
12
-
13
- * 1 minor enhancement:
14
- * New version for asynchronous job. In this case it uses fork to spawn new
15
- processes.
16
-
17
-
18
-
19
- == 1.1.7 2008-11-27
20
-
21
- * 2 minor enhancement:
22
- * Inline methods are prepended '_inline_' to avoid polluting namespace
23
- * Asynchronous jobs have a hash where they can save information, it is
24
- accessible through the 'info' WS method in YAML format
25
-
26
- == 1.1.6 2008-11-24
27
-
28
- * 1 minor enhancement:
29
- * Added documentation
30
-
31
-
32
- == 1.1.5 2008-10-28
33
-
34
- * 1 major enhancement:
35
- * Jobs save their states across reboots of the server
36
-
37
- == 1.1.4 2008-10-28
38
-
39
- * 1 major enhancement:
40
- * Web Service with asynchronous jobs
41
-
42
- == 1.0.2 2008-10-28
43
-
44
- * 1 bug fix:
45
- * In using the easy client driver creation
46
-
47
- == 1.0.1 2008-10-27
48
-
49
- * 1 major enhancement:
50
- * Easy creation of client driver. Connects to a url and retrieves the WSDL
51
- and uses it to generate driver
52
-
53
-
54
- == 1.0.0 2008-10-10
55
-
56
- * 1 major enhancement:
57
- * Initial release
data/Manifest.txt DELETED
@@ -1,26 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- PostInstall.txt
4
- README.rdoc
5
- Rakefile
6
- config/hoe.rb
7
- config/requirements.rb
8
- lib/simplews.rb
9
- lib/simplews/jobs.rb
10
- script/console
11
- script/destroy
12
- script/generate
13
- script/txt2html
14
- setup.rb
15
- simplews.gemspec
16
- tasks/deployment.rake
17
- tasks/environment.rake
18
- tasks/website.rake
19
- test/simplews/test_jobs.rb
20
- test/test_helper.rb
21
- test/test_simplews.rb
22
- website/index.html
23
- website/index.txt
24
- website/javascripts/rounded_corners_lite.inc.js
25
- website/stylesheets/screen.css
26
- website/template.html.erb
data/PostInstall.txt DELETED
@@ -1,7 +0,0 @@
1
-
2
- For more information on simplews, see http://simplews.rubyforge.org
3
-
4
- NOTE: Change this information in PostInstall.txt
5
- You can also delete it if you don't want it.
6
-
7
-
data/Rakefile DELETED
@@ -1,28 +0,0 @@
1
- %w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
2
- require File.dirname(__FILE__) + '/lib/simplews'
3
-
4
- # Generate all the Rake tasks
5
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
6
- $hoe = Hoe.new('simplews', SimpleWS::VERSION) do |p|
7
- p.developer('Miguel Vazquez', 'mikisvaz@yahoo.com')
8
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
9
- p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
10
- p.rubyforge_name = p.name # TODO this is default value
11
- # p.extra_deps = [
12
- # ['activesupport','>= 2.0.2'],
13
- # ]
14
- p.extra_dev_deps = [
15
- ['newgem', ">= #{::Newgem::VERSION}"]
16
- ]
17
-
18
- p.clean_globs |= %w[**/.DS_Store tmp *.log]
19
- path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
20
- p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
21
- p.rsync_args = '-av --delete --ignore-errors'
22
- end
23
-
24
- require 'newgem/tasks' # load /tasks/*.rake
25
- Dir['tasks/**/*.rake'].each { |t| load t }
26
-
27
- # TODO - want other tests/tasks run by default? Add them to the list
28
- # task :default => [:spec, :features]
data/config/hoe.rb DELETED
@@ -1,73 +0,0 @@
1
- require 'simplews/version'
2
-
3
- AUTHOR = 'Miguel Vazquez' # can also be an array of Authors
4
- EMAIL = "miguel.vazquez@fdi.ucm.es"
5
- DESCRIPTION = "Simplifies the development of Web Services, producing WSDL automatically for example. Wraps soap4r."
6
- GEM_NAME = 'simplews' # what ppl will type to install your gem
7
- RUBYFORGE_PROJECT = 'simplews' # The unix name for your project
8
- HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
9
- DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
10
- EXTRA_DEPENDENCIES = [
11
- # ['activesupport', '>= 1.3.1']
12
- ] # An array of rubygem dependencies [name, version]
13
-
14
- @config_file = "~/.rubyforge/user-config.yml"
15
- @config = nil
16
- RUBYFORGE_USERNAME = "unknown"
17
- def rubyforge_username
18
- unless @config
19
- begin
20
- @config = YAML.load(File.read(File.expand_path(@config_file)))
21
- rescue
22
- puts <<-EOS
23
- ERROR: No rubyforge config file found: #{@config_file}
24
- Run 'rubyforge setup' to prepare your env for access to Rubyforge
25
- - See http://newgem.rubyforge.org/rubyforge.html for more details
26
- EOS
27
- exit
28
- end
29
- end
30
- RUBYFORGE_USERNAME.replace @config["username"]
31
- end
32
-
33
-
34
- REV = nil
35
- # UNCOMMENT IF REQUIRED:
36
- # REV = YAML.load(`svn info`)['Revision']
37
- VERS = Simplews::VERSION::STRING + (REV ? ".#{REV}" : "")
38
- RDOC_OPTS = ['--quiet', '--title', 'simplews documentation',
39
- "--opname", "index.html",
40
- "--line-numbers",
41
- "--main", "README",
42
- "--inline-source"]
43
-
44
- class Hoe
45
- def extra_deps
46
- @extra_deps.reject! { |x| Array(x).first == 'hoe' }
47
- @extra_deps
48
- end
49
- end
50
-
51
- # Generate all the Rake tasks
52
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
53
- $hoe = Hoe.new(GEM_NAME, VERS) do |p|
54
- p.developer(AUTHOR, EMAIL)
55
- p.description = DESCRIPTION
56
- p.summary = DESCRIPTION
57
- p.url = HOMEPATH
58
- p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
59
- p.test_globs = ["test/**/test_*.rb"]
60
- p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
61
-
62
- # == Optional
63
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
64
- #p.extra_deps = EXTRA_DEPENDENCIES
65
-
66
- #p.spec_extras = {} # A hash of extra values to set in the gemspec.
67
- end
68
-
69
- CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
70
- PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
71
- $hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
72
- $hoe.rsync_args = '-av --delete --ignore-errors'
73
- $hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
@@ -1,15 +0,0 @@
1
- require 'fileutils'
2
- include FileUtils
3
-
4
- require 'rubygems'
5
- %w[rake hoe newgem rubigen].each do |req_gem|
6
- begin
7
- require req_gem
8
- rescue LoadError
9
- puts "This Rakefile requires the '#{req_gem}' RubyGem."
10
- puts "Installation: gem install #{req_gem} -y"
11
- exit
12
- end
13
- end
14
-
15
- $:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
data/script/console DELETED
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # File: script/console
3
- irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
-
5
- libs = " -r irb/completion"
6
- # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
- # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
- libs << " -r #{File.dirname(__FILE__) + '/../lib/simplews.rb'}"
9
- puts "Loading simplews gem"
10
- exec "#{irb} #{libs} --simple-prompt"
data/script/destroy DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/destroy'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Destroy.new.run(ARGV)
data/script/generate DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/generate'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Generate.new.run(ARGV)