webtask 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 007d5d66dd97290527a26b48f98ba1946715d4c8
4
- data.tar.gz: 7fdeab7977c7db4dd6e632644daad30eb4c419c1
3
+ metadata.gz: 3423555698859c5fccb589b93a1c9ac7b91744ef
4
+ data.tar.gz: 5da981fba76595d0d7026e049e13bf653718e984
5
5
  SHA512:
6
- metadata.gz: 3be048018b33abb141d2f3a8c4c7a1e974f41f75a17554dab5249ddd2ff111f705861d6b51cd9cee52e6982648a1bd01c07faa7a9a31505d94a1e90134ad8f77
7
- data.tar.gz: d5c38382e0e70a3cbd5e04955470aef727c7de19af3056d211b910f31eb15e1e96982cb9959cd849c723de86374a2680a2cd6d5e64ce130c3386702d6b87561f
6
+ metadata.gz: 212ade0002edf412b29f240764f113d26ccdc43600deef8b029711f84a6d27c8e70123af20cc5c2fa191543aa549d38456f94160857ee1c8f95c158dff75b7b0
7
+ data.tar.gz: 27ba545c1a7290b8e77d3fbb6d23c5eb9e80823de27171307b83c15a5c61d96a9b6a8fdaca052771fc917024d9f11515cf02793a6fb0769b4c3c9d8455cfea79
@@ -1,5 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "webtask"
3
+ require "clap"
4
+ require "webtask/cli"
5
+
6
+ Clap.run ARGV,
7
+ "-b" => lambda { |bind| Webtask::CLI.instance.bind = bind },
8
+ "-p" => lambda { |port| Webtask::CLI.instance.port = Integer(port) },
9
+ "-h" => lambda { Webtask::CLI.instance.show_help }
4
10
 
11
+ require "webtask"
5
12
  Webtask::Application.run!
@@ -3,6 +3,8 @@ module Webtask
3
3
  set :server, "thin"
4
4
  set :output_streams, {}
5
5
  set :public_folder, File.dirname(__FILE__) + "/public"
6
+ set :bind, Webtask::CLI.instance.bind
7
+ set :port, Webtask::CLI.instance.port
6
8
 
7
9
  RakeApplication.build_task_endpoints(self)
8
10
 
@@ -0,0 +1,30 @@
1
+ require 'singleton'
2
+
3
+ module Webtask
4
+ class CLI
5
+ include Singleton
6
+
7
+ DEFAULT_PORT = 4567.freeze
8
+ DEFAULT_BIND = "127.0.0.1".freeze
9
+
10
+ attr_accessor :port
11
+ attr_accessor :bind
12
+
13
+ def initialize
14
+ @port = DEFAULT_PORT
15
+ @bind = DEFAULT_BIND
16
+ end
17
+
18
+ def show_help
19
+ puts <<~HELP_TEXT
20
+ webtask – A web GUI for your Rake tasks
21
+
22
+ Options:
23
+
24
+ -b bind to a different address (default: #{DEFAULT_BIND})
25
+ -p bind to a different port (default: #{DEFAULT_PORT})
26
+ HELP_TEXT
27
+ exit
28
+ end
29
+ end
30
+ end
@@ -30,7 +30,7 @@ module Webtask
30
30
  return @rake_app if @rake_app
31
31
 
32
32
  @rake_app = Rake.application
33
- @rake_app.init
33
+ @rake_app.options.rakelib = [ "rakelib" ]
34
34
  @rake_app.load_rakefile
35
35
 
36
36
  return @rake_app
@@ -1,3 +1,3 @@
1
1
  module Webtask
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency "thin", "~> 1.7.0"
25
25
  spec.add_dependency "haml", "~> 4.0.7"
26
26
  spec.add_dependency "markdown", "~> 1.2.0"
27
+ spec.add_dependency "clap", "~> 1.0.0"
27
28
 
28
29
  spec.add_development_dependency "bundler", "~> 1.12"
29
30
  spec.add_development_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webtask
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yakshed / Dirk Breuer
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.2.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: clap
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 1.0.0
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 1.0.0
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: bundler
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -180,7 +194,6 @@ files:
180
194
  - CODE_OF_CONDUCT.md
181
195
  - CONTRIBUTING.md
182
196
  - Gemfile
183
- - Gemfile.lock
184
197
  - LICENSE
185
198
  - README.md
186
199
  - Rakefile
@@ -191,6 +204,7 @@ files:
191
204
  - exe/webtask
192
205
  - lib/webtask.rb
193
206
  - lib/webtask/application.rb
207
+ - lib/webtask/cli.rb
194
208
  - lib/webtask/public/javascripts/application.js
195
209
  - lib/webtask/public/stylesheets/application.css
196
210
  - lib/webtask/public/stylesheets/application.css.map