socks 0.2.10.beta → 0.2.11.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/socks +29 -9
- data/lib/socks.rb +3 -1
- data/lib/socks/config.rb +2 -0
- data/lib/socks/helpers.rb +10 -1
- data/lib/socks/router.rb +1 -1
- data/lib/socks/router_helpers.rb +1 -1
- data/lib/socks/tasks/rake_tasks.rb +23 -3
- data/lib/socks/version.rb +1 -2
- metadata +2 -2
data/bin/socks
CHANGED
@@ -1,23 +1,34 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require 'rubygems'
|
4
|
-
require 'commander/import'
|
3
|
+
require 'rubygems' # Only needed for early versions.
|
4
|
+
require 'commander/import' # Commander
|
5
|
+
|
6
|
+
# Socks
|
5
7
|
require 'socks'
|
8
|
+
require 'socks/version'
|
9
|
+
require 'socks/helpers'
|
10
|
+
|
11
|
+
# For mkdir(), cd(), touch(), etc.
|
6
12
|
require 'fileutils'
|
7
13
|
|
8
|
-
|
14
|
+
|
15
|
+
program :version, '0.2.10.beta'
|
9
16
|
program :description, 'A Ruby-Rack-based microframework'
|
10
17
|
|
11
|
-
default_command :about
|
18
|
+
default_command :about # Set default command to show the Socks 'about' page.
|
12
19
|
|
13
20
|
command :new do |c|
|
14
21
|
c.syntax = 'socks new [options]'
|
15
22
|
c.summary = 'Create a new Socks app'
|
16
23
|
c.description = 'Use Rack and other utilities to make a new Socks app from scratch'
|
17
|
-
|
24
|
+
|
25
|
+
c.action do |args, opts|
|
26
|
+
|
27
|
+
# Helpers!
|
28
|
+
include Socks::Helpers
|
18
29
|
|
19
|
-
# Pull out the first arg in args[]
|
20
|
-
app = args[0]
|
30
|
+
# Pull out the first arg in args[...]
|
31
|
+
app = args[0] # This is the app name.
|
21
32
|
|
22
33
|
# -------------------------------------------------------------------------
|
23
34
|
# File Contents |
|
@@ -45,7 +56,7 @@ use Rack::Reloader, 0
|
|
45
56
|
|
46
57
|
# Used to run your router (app!)
|
47
58
|
# Go to config/router.rb to declare routes
|
48
|
-
run #{app.capitalize}::Router"
|
59
|
+
run #{to_class(app.capitalize)}::Router"
|
49
60
|
|
50
61
|
gemfile = "# List dependencies for your app in your Gemfile, then run the `bundle` command
|
51
62
|
|
@@ -95,7 +106,7 @@ require File.expand_path(\"../lib/custom_tasks.rb\", __FILE__)"
|
|
95
106
|
require \"http_router\"
|
96
107
|
require \"socks\"
|
97
108
|
|
98
|
-
module #{app.capitalize}
|
109
|
+
module #{to_class(app.capitalize)}
|
99
110
|
Router = HttpRouter.new do
|
100
111
|
|
101
112
|
# See what you can do at https://github.com/joshbuddy/http_router
|
@@ -197,6 +208,7 @@ end
|
|
197
208
|
system("echo '#{cont_template}' >> app/controllers/#{cont}_controller.rb")
|
198
209
|
|
199
210
|
end
|
211
|
+
|
200
212
|
end
|
201
213
|
|
202
214
|
command :start do |c|
|
@@ -224,6 +236,14 @@ command :version do |c|
|
|
224
236
|
end
|
225
237
|
end
|
226
238
|
|
239
|
+
command :update do |c|
|
240
|
+
c.syntax = 'socks update [options]'
|
241
|
+
c.description = 'Updated Socks'
|
242
|
+
c.action do |args, opts|
|
243
|
+
system('gem update socks')
|
244
|
+
end
|
245
|
+
end
|
246
|
+
|
227
247
|
command :about do |c|
|
228
248
|
c.syntax = 'socks about [options]'
|
229
249
|
c.action do |args, options|
|
data/lib/socks.rb
CHANGED
data/lib/socks/config.rb
CHANGED
data/lib/socks/helpers.rb
CHANGED
data/lib/socks/router.rb
CHANGED
data/lib/socks/router_helpers.rb
CHANGED
@@ -1,6 +1,26 @@
|
|
1
1
|
require 'rake'
|
2
|
+
require 'socks/helpers'
|
2
3
|
|
3
|
-
desc '
|
4
|
-
task :
|
5
|
-
|
4
|
+
desc 'About Socks'
|
5
|
+
task :about do
|
6
|
+
|
7
|
+
puts "Socks is a small, elegant, and simple framework for making web-apps using"
|
8
|
+
puts "Ruby, Rack, and many other various Gems."
|
9
|
+
|
10
|
+
puts ""
|
11
|
+
|
12
|
+
puts "Socks started out as a small experiment (originally called simple_rack)"
|
13
|
+
puts "that supplied a few methods for making apps."
|
14
|
+
|
15
|
+
puts ""
|
16
|
+
|
17
|
+
puts "Now that I've found so many interesting gems and resources, Socksc cont-"
|
18
|
+
puts "inues to retain in development, now with much more than ever planned!"
|
19
|
+
|
6
20
|
end
|
21
|
+
|
22
|
+
desc 'Run your RSpec tests'
|
23
|
+
task(:test) { system('rspec .') }
|
24
|
+
|
25
|
+
desc 'View your todos using do_it'
|
26
|
+
task(:todos) { system('do_it') }
|
data/lib/socks/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.11.beta
|
5
5
|
prerelease: 7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|