pow-index 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +29 -0
- data/Rakefile +9 -0
- data/VERSION +1 -0
- data/lib/pow-index.rb +49 -45
- data/lib/pow-index/version.rb +3 -0
- data/pow-index.gemspec +27 -0
- data/test/helper.rb +10 -0
- data/test/test_pow-index.rb +15 -0
- metadata +59 -35
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
pow-index (0.0.3)
|
5
|
+
haml (>= 3.1.0)
|
6
|
+
sinatra (>= 1.2.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
haml (3.1.3)
|
12
|
+
rack (1.3.2)
|
13
|
+
rack-test (0.6.1)
|
14
|
+
rack (>= 1.0)
|
15
|
+
rake (0.9.2)
|
16
|
+
shoulda (2.11.3)
|
17
|
+
sinatra (1.2.6)
|
18
|
+
rack (~> 1.1)
|
19
|
+
tilt (>= 1.2.2, < 2.0)
|
20
|
+
tilt (1.3.3)
|
21
|
+
|
22
|
+
PLATFORMS
|
23
|
+
ruby
|
24
|
+
|
25
|
+
DEPENDENCIES
|
26
|
+
pow-index!
|
27
|
+
rack-test (~> 0.6.1)
|
28
|
+
rake (= 0.9.2)
|
29
|
+
shoulda
|
data/Rakefile
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.2
|
data/lib/pow-index.rb
CHANGED
@@ -1,31 +1,32 @@
|
|
1
|
+
require "pow-index/version"
|
1
2
|
require 'sinatra/base'
|
2
3
|
|
3
4
|
module PowIndex
|
4
5
|
|
5
|
-
|
6
|
+
class App < Sinatra::Base
|
6
7
|
|
7
|
-
|
8
|
-
|
8
|
+
POW_PATH = "#{ENV['HOME']}/.pow"
|
9
|
+
enable :inline_templates
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
get '/cleanup' do
|
16
|
-
require 'fileutils'
|
17
|
-
Dir[POW_PATH + "/*"].map { |symlink| FileUtils.rm(symlink) unless File.exists? File.readlink(symlink) }
|
18
|
-
@pows = Dir[POW_PATH + "/*"].map { |link| File.basename(link) }
|
19
|
-
haml :linktable
|
20
|
-
end
|
11
|
+
get '/' do
|
12
|
+
@pows = Dir[POW_PATH + "/*"].map { |link| File.basename(link) }
|
13
|
+
haml :index
|
14
|
+
end
|
21
15
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
get '/cleanup' do
|
17
|
+
require 'fileutils'
|
18
|
+
Dir[POW_PATH + "/*"].map { |symlink| FileUtils.rm(symlink) unless File.exists? File.readlink(symlink) }
|
19
|
+
@pows = Dir[POW_PATH + "/*"].map { |link| File.basename(link) }
|
20
|
+
haml :linktable
|
21
|
+
end
|
26
22
|
|
23
|
+
get '/linktable' do
|
24
|
+
@pows = Dir[POW_PATH + "/*"].map { |link| File.basename(link) }
|
25
|
+
haml :linktable
|
27
26
|
end
|
28
27
|
|
28
|
+
end
|
29
|
+
|
29
30
|
end
|
30
31
|
|
31
32
|
__END__
|
@@ -36,31 +37,7 @@ __END__
|
|
36
37
|
%title pow index
|
37
38
|
%link{:rel => 'stylesheet', :href => 'http://twitter.github.com/bootstrap/assets/css/bootstrap-1.2.0.min.css'}
|
38
39
|
%script{:type => 'text/javascript', :src => 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js'}
|
39
|
-
:
|
40
|
-
function loadtable(){
|
41
|
-
$('#linktable').load('/linktable')
|
42
|
-
}
|
43
|
-
function toggle(){
|
44
|
-
$.each(['toggle', 'confirm'], function() {
|
45
|
-
if(document.getElementById(this).style.display == 'none'){
|
46
|
-
document.getElementById(this).style.display = 'block';
|
47
|
-
}else{
|
48
|
-
document.getElementById(this).style.display = 'none';
|
49
|
-
}
|
50
|
-
})
|
51
|
-
}
|
52
|
-
function cleanup() {
|
53
|
-
$.ajax({
|
54
|
-
type: "GET",
|
55
|
-
url: "/cleanup",
|
56
|
-
dataType: "html",
|
57
|
-
success: function(){
|
58
|
-
loadtable();
|
59
|
-
toggle();
|
60
|
-
}
|
61
|
-
})
|
62
|
-
}
|
63
|
-
$(function(){ loadtable(); })
|
40
|
+
= haml :js
|
64
41
|
%body
|
65
42
|
.container
|
66
43
|
%h1 pow index
|
@@ -68,7 +45,7 @@ __END__
|
|
68
45
|
.row
|
69
46
|
%button.btn.small#toggle{:onClick => 'toggle()'} Cleanup
|
70
47
|
.alert-message.block-message.warning#confirm{'style' => 'display: none'}
|
71
|
-
%button.btn.small{:onClick => 'cleanup()'}
|
48
|
+
%button.btn.small{:onClick => 'cleanup()'} Cleanup
|
72
49
|
%button.btn.small{:onClick => 'toggle()'} Cancel
|
73
50
|
%p= "Pushing 'Cleanup' removes invalid symbolic link in ~/.pow"
|
74
51
|
|
@@ -77,5 +54,32 @@ __END__
|
|
77
54
|
- @pows.each do |pow|
|
78
55
|
%tr
|
79
56
|
%td
|
80
|
-
%a{:href => "http://#{pow}.dev" }
|
57
|
+
%a{:href => "http://#{pow}.dev" :target => "_blank"}
|
81
58
|
= pow
|
59
|
+
|
60
|
+
@@ js
|
61
|
+
:javascript
|
62
|
+
function loadtable(){
|
63
|
+
$('#linktable').load('/linktable')
|
64
|
+
}
|
65
|
+
function toggle(){
|
66
|
+
$.each(['toggle', 'confirm'], function() {
|
67
|
+
if(document.getElementById(this).style.display == 'none'){
|
68
|
+
document.getElementById(this).style.display = 'block';
|
69
|
+
}else{
|
70
|
+
document.getElementById(this).style.display = 'none';
|
71
|
+
}
|
72
|
+
})
|
73
|
+
}
|
74
|
+
function cleanup() {
|
75
|
+
$.ajax({
|
76
|
+
type: "GET",
|
77
|
+
url: "/cleanup",
|
78
|
+
dataType: "html",
|
79
|
+
success: function(){
|
80
|
+
loadtable();
|
81
|
+
toggle();
|
82
|
+
}
|
83
|
+
})
|
84
|
+
}
|
85
|
+
$(function(){ loadtable(); })
|
data/pow-index.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "pow-index/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "pow-index"
|
7
|
+
s.version = PowIndex::VERSION
|
8
|
+
s.authors = ["marutanm"]
|
9
|
+
s.email = ["marutanm@gmail.com"]
|
10
|
+
s.homepage = "http://github.com/marutanm/pow-index"
|
11
|
+
s.summary = "Create index page of 37signals-Pow"
|
12
|
+
s.description = "Create index page of 37signals-Pow"
|
13
|
+
|
14
|
+
s.rubyforge_project = "pow-index"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_runtime_dependency("sinatra", [">= 1.2.0"])
|
22
|
+
s.add_runtime_dependency("haml", [">= 3.1.0"])
|
23
|
+
s.add_development_dependency("shoulda", [">= 0"])
|
24
|
+
s.add_development_dependency("rack-test", ["~> 0.6.1"])
|
25
|
+
s.add_development_dependency("rake", ["0.9.2"])
|
26
|
+
|
27
|
+
end
|
data/test/helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pow-index
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,67 +9,86 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: &
|
15
|
+
name: sinatra
|
16
|
+
requirement: &70238289519640 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
22
|
-
type: :
|
21
|
+
version: 1.2.0
|
22
|
+
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70238289519640
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
27
|
-
requirement: &
|
26
|
+
name: haml
|
27
|
+
requirement: &70238289519120 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
|
-
- -
|
30
|
+
- - ! '>='
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.
|
33
|
-
type: :
|
32
|
+
version: 3.1.0
|
33
|
+
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70238289519120
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
-
requirement: &
|
37
|
+
name: shoulda
|
38
|
+
requirement: &70238289518640 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
44
|
-
type: :
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70238289518640
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
49
|
-
requirement: &
|
48
|
+
name: rack-test
|
49
|
+
requirement: &70238289518160 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
55
|
-
type: :
|
54
|
+
version: 0.6.1
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70238289518160
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: rake
|
60
|
+
requirement: &70238289517680 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - =
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 0.9.2
|
66
|
+
type: :development
|
56
67
|
prerelease: false
|
57
|
-
version_requirements: *
|
68
|
+
version_requirements: *70238289517680
|
58
69
|
description: Create index page of 37signals-Pow
|
59
|
-
email:
|
70
|
+
email:
|
71
|
+
- marutanm@gmail.com
|
60
72
|
executables:
|
61
73
|
- pow-index
|
62
74
|
extensions: []
|
63
|
-
extra_rdoc_files:
|
64
|
-
- README.md
|
75
|
+
extra_rdoc_files: []
|
65
76
|
files:
|
77
|
+
- .gitignore
|
78
|
+
- Gemfile
|
79
|
+
- Gemfile.lock
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- VERSION
|
66
83
|
- bin/pow-index
|
67
84
|
- config.ru
|
68
85
|
- lib/pow-index.rb
|
69
|
-
-
|
86
|
+
- lib/pow-index/version.rb
|
87
|
+
- pow-index.gemspec
|
88
|
+
- test/helper.rb
|
89
|
+
- test/test_pow-index.rb
|
70
90
|
homepage: http://github.com/marutanm/pow-index
|
71
|
-
licenses:
|
72
|
-
- MIT
|
91
|
+
licenses: []
|
73
92
|
post_install_message:
|
74
93
|
rdoc_options: []
|
75
94
|
require_paths:
|
@@ -82,17 +101,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
101
|
version: '0'
|
83
102
|
segments:
|
84
103
|
- 0
|
85
|
-
hash:
|
104
|
+
hash: 2093921528024344917
|
86
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
106
|
none: false
|
88
107
|
requirements:
|
89
108
|
- - ! '>='
|
90
109
|
- !ruby/object:Gem::Version
|
91
110
|
version: '0'
|
111
|
+
segments:
|
112
|
+
- 0
|
113
|
+
hash: 2093921528024344917
|
92
114
|
requirements: []
|
93
|
-
rubyforge_project:
|
94
|
-
rubygems_version: 1.8.
|
115
|
+
rubyforge_project: pow-index
|
116
|
+
rubygems_version: 1.8.11
|
95
117
|
signing_key:
|
96
118
|
specification_version: 3
|
97
119
|
summary: Create index page of 37signals-Pow
|
98
|
-
test_files:
|
120
|
+
test_files:
|
121
|
+
- test/helper.rb
|
122
|
+
- test/test_pow-index.rb
|