bowline 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.txt +5 -2
- data/Rakefile +11 -0
- data/TODO +0 -3
- data/VERSION +1 -1
- data/bowline.gemspec +13 -3
- data/lib/bowline.rb +3 -3
- data/lib/bowline/commands/console.rb +8 -12
- data/lib/bowline/desktop/network.rb +62 -2
- data/lib/bowline/desktop/path.rb +30 -0
- data/lib/bowline/desktop/window_methods.rb +2 -2
- data/lib/bowline/ext/object.rb +3 -1
- data/lib/bowline/generators.rb +7 -2
- data/lib/bowline/generators/application.rb +1 -1
- data/lib/bowline/initializer.rb +4 -2
- data/lib/bowline/version.rb +1 -1
- data/templates/Gemfile +3 -3
- data/templates/script/build +1 -1
- data/templates/script/console +1 -1
- data/templates/script/generate +1 -1
- data/templates/script/init +1 -1
- data/templates/script/run +1 -1
- metadata +45 -22
data/README.txt
CHANGED
@@ -45,10 +45,13 @@ http://groups.google.com/group/bowline-dev
|
|
45
45
|
|
46
46
|
= REQUIREMENTS
|
47
47
|
|
48
|
-
- Mac OSX
|
49
|
-
- Ruby 1.9
|
48
|
+
- Mac OSX >=10.5 or Ubuntu
|
49
|
+
- Ruby 1.9
|
50
50
|
- Bowline gem
|
51
51
|
|
52
|
+
If you're on Ubuntu, you'll need to run:
|
53
|
+
apt-get install libwebkit-dev
|
54
|
+
|
52
55
|
The other required libraries, such as bowline-desktop, are downloaded later by Bowline - you don't need to worry about these.
|
53
56
|
|
54
57
|
= INSTALLATION
|
data/Rakefile
CHANGED
@@ -11,6 +11,17 @@ begin
|
|
11
11
|
gemspec.add_dependency('activesupport', '>= 3.0.0.beta')
|
12
12
|
gemspec.add_dependency('rubyzip2', '>= 2.0.1')
|
13
13
|
gemspec.add_dependency('supermodel')
|
14
|
+
|
15
|
+
gemspec.post_install_message = <<-POST_INSTALL_MESSAGE
|
16
|
+
#{'*'*50}
|
17
|
+
|
18
|
+
Thank you for installing Bowline.
|
19
|
+
|
20
|
+
If you're on Linux, please install the WebKit library:
|
21
|
+
sudo apt-get install libwebkit-dev
|
22
|
+
|
23
|
+
#{'*'*50}
|
24
|
+
POST_INSTALL_MESSAGE
|
14
25
|
end
|
15
26
|
rescue LoadError
|
16
27
|
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
data/TODO
CHANGED
@@ -11,7 +11,6 @@ Add --version to bowline-gen
|
|
11
11
|
|
12
12
|
Developer tools:
|
13
13
|
F5 to reload page
|
14
|
-
Show inspector
|
15
14
|
Reload ruby
|
16
15
|
|
17
16
|
Tutorials:
|
@@ -21,9 +20,7 @@ Tutorials:
|
|
21
20
|
CSS search box & placeholder
|
22
21
|
|
23
22
|
- Don't run initializers during rake tasks
|
24
|
-
- Find out why build is taking so long
|
25
23
|
- Add first-run initializers
|
26
|
-
- Add reload keyboard shortcut
|
27
24
|
- Add some sort of production mode
|
28
25
|
- Generate correct shebang on script files
|
29
26
|
- Use App.root rather than APP_ROOT
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.2
|
data/bowline.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{bowline}
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alex MacCaw"]
|
12
|
-
s.date = %q{2010-02-
|
12
|
+
s.date = %q{2010-02-25}
|
13
13
|
s.default_executable = %q{bowline-gen}
|
14
14
|
s.description = %q{Ruby/JS GUI framework}
|
15
15
|
s.email = %q{alex@leadthinking.com}
|
@@ -66,6 +66,7 @@ Gem::Specification.new do |s|
|
|
66
66
|
"lib/bowline/desktop/js.rb",
|
67
67
|
"lib/bowline/desktop/misc.rb",
|
68
68
|
"lib/bowline/desktop/network.rb",
|
69
|
+
"lib/bowline/desktop/path.rb",
|
69
70
|
"lib/bowline/desktop/proxy.rb",
|
70
71
|
"lib/bowline/desktop/runtime.rb",
|
71
72
|
"lib/bowline/desktop/sound.rb",
|
@@ -119,9 +120,18 @@ Gem::Specification.new do |s|
|
|
119
120
|
"vendor/progressbar.rb"
|
120
121
|
]
|
121
122
|
s.homepage = %q{http://github.com/maccman/bowline}
|
123
|
+
s.post_install_message = %q{ **************************************************
|
124
|
+
|
125
|
+
Thank you for installing Bowline.
|
126
|
+
|
127
|
+
If you're on Linux, please install the WebKit library:
|
128
|
+
sudo apt-get install libwebkit-dev
|
129
|
+
|
130
|
+
**************************************************
|
131
|
+
}
|
122
132
|
s.rdoc_options = ["--charset=UTF-8"]
|
123
133
|
s.require_paths = ["lib"]
|
124
|
-
s.rubygems_version = %q{1.3.
|
134
|
+
s.rubygems_version = %q{1.3.6}
|
125
135
|
s.summary = %q{Bowline GUI framework}
|
126
136
|
s.test_files = [
|
127
137
|
"examples/tweet.rb",
|
data/lib/bowline.rb
CHANGED
@@ -23,8 +23,8 @@ module Bowline
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
$LOAD_PATH
|
27
|
-
$LOAD_PATH << File.join(Bowline.lib_path,
|
26
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
27
|
+
$LOAD_PATH << File.join(Bowline.lib_path, 'vendor')
|
28
28
|
|
29
29
|
require 'bowline/version'
|
30
30
|
|
@@ -61,4 +61,4 @@ require 'bowline/initializer'
|
|
61
61
|
require 'bowline/binders'
|
62
62
|
require 'bowline/binders/observer'
|
63
63
|
require 'bowline/binders/collection'
|
64
|
-
require 'bowline/binders/singleton'
|
64
|
+
require 'bowline/binders/singleton'
|
@@ -1,22 +1,17 @@
|
|
1
|
-
|
1
|
+
require "optparse"
|
2
|
+
require "irb"
|
3
|
+
require "irb/completion"
|
2
4
|
|
3
|
-
|
4
|
-
|
5
|
-
options = { :irb => irb }
|
5
|
+
options = {}
|
6
6
|
OptionParser.new do |opt|
|
7
7
|
opt.banner = "Usage: console [environment] [options]"
|
8
|
-
opt.on("--
|
9
|
-
opt.on("--debugger", 'Enable ruby-debugging for the console.') { |v| options[:debugger] = v }
|
8
|
+
opt.on("--debugger", "Enable ruby-debugging for the console.") { |v| options[:debugger] = v }
|
10
9
|
opt.parse!(ARGV)
|
11
10
|
end
|
12
11
|
|
13
|
-
libs = " -r irb/completion"
|
14
|
-
libs << %( -r "#{APP_ROOT}/config/environment")
|
15
|
-
|
16
12
|
if options[:debugger]
|
17
13
|
begin
|
18
|
-
require
|
19
|
-
libs << " -r ruby-debug"
|
14
|
+
require "ruby-debug"
|
20
15
|
puts "=> Debugger enabled"
|
21
16
|
rescue Exception
|
22
17
|
puts "You need to install ruby-debug to run the console in debugging mode. With gems, use 'gem install ruby-debug'"
|
@@ -24,4 +19,5 @@ if options[:debugger]
|
|
24
19
|
end
|
25
20
|
end
|
26
21
|
|
27
|
-
|
22
|
+
require "#{APP_ROOT}/config/environment"
|
23
|
+
IRB.start
|
@@ -1,7 +1,67 @@
|
|
1
|
+
require "socket"
|
2
|
+
require "timeout"
|
3
|
+
|
1
4
|
module Bowline
|
2
5
|
module Desktop
|
3
|
-
|
4
|
-
|
6
|
+
module Network
|
7
|
+
extend Bowline::Watcher::Base
|
8
|
+
watch :on_online, :on_offline, :on_change
|
9
|
+
|
10
|
+
def online!
|
11
|
+
return if @online
|
12
|
+
@online = true
|
13
|
+
watcher.call(:on_online)
|
14
|
+
watcher.call(:on_change)
|
15
|
+
end
|
16
|
+
|
17
|
+
def offline!
|
18
|
+
return unless @online
|
19
|
+
@online = false
|
20
|
+
watcher.call(:on_offline)
|
21
|
+
watcher.call(:on_change)
|
22
|
+
end
|
23
|
+
|
24
|
+
def online?
|
25
|
+
@online
|
26
|
+
end
|
27
|
+
|
28
|
+
def host
|
29
|
+
@host ||= "google.com"
|
30
|
+
end
|
31
|
+
|
32
|
+
def host=(host)
|
33
|
+
@host = host
|
34
|
+
end
|
35
|
+
|
36
|
+
def port
|
37
|
+
@port ||= 80
|
38
|
+
end
|
39
|
+
|
40
|
+
def port=(port)
|
41
|
+
@port = port
|
42
|
+
end
|
43
|
+
|
44
|
+
def poll!
|
45
|
+
Thread.new do
|
46
|
+
loop do
|
47
|
+
ping ? online! : offline!
|
48
|
+
sleep 30
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
def ping
|
56
|
+
Timeout::timeout(3) {
|
57
|
+
TCPSocket.new(host, port).close
|
58
|
+
}
|
59
|
+
true
|
60
|
+
rescue Errno::ECONNREFUSED, Timeout::Error, StandardError
|
61
|
+
false
|
62
|
+
end
|
63
|
+
|
64
|
+
extend self
|
5
65
|
end
|
6
66
|
end
|
7
67
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Bowline
|
2
|
+
module Desktop
|
3
|
+
module Path
|
4
|
+
##
|
5
|
+
# :singleton-method: documents
|
6
|
+
# Get the users documents dir.
|
7
|
+
# * Unix: ~ (the home directory)
|
8
|
+
# * Windows: "C:\Documents and Settings\username\My Documents"
|
9
|
+
# * Mac: ~/Documents
|
10
|
+
|
11
|
+
##
|
12
|
+
# :singleton-method: data
|
13
|
+
# Get the app's data dir.
|
14
|
+
# * Unix: prefix/share/appinfo
|
15
|
+
# * Windows: the directory where the executable file is located
|
16
|
+
# * Mac: appinfo.app/Contents/SharedSupport bundle subdirectory
|
17
|
+
|
18
|
+
##
|
19
|
+
# :singleton-method: user_data
|
20
|
+
# Get the app's user data dir.
|
21
|
+
# * Unix: ~/.appinfo
|
22
|
+
# * Windows: "C:\Documents and Settings\username\Application Data\appinfo"
|
23
|
+
# * Mac: "~/Library/Application Support/appinfo".
|
24
|
+
|
25
|
+
##
|
26
|
+
# :singleton-method: temp
|
27
|
+
# Get the tempory directory
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -35,13 +35,13 @@ module Bowline
|
|
35
35
|
self._url = address.to_s
|
36
36
|
end
|
37
37
|
|
38
|
-
def
|
38
|
+
def select_file(options = {})
|
39
39
|
flags = 0
|
40
40
|
flags |= Window::FD_OPEN if options[:open]
|
41
41
|
flags |= Window::FD_SAVE if options[:save]
|
42
42
|
flags |= Window::FD_OVERWRITE_PROMPT if options[:overwrite_prompt]
|
43
43
|
flags |= Window::FD_FILE_MUST_EXIST if options[:file_must_exist]
|
44
|
-
|
44
|
+
_select_file(
|
45
45
|
options[:message],
|
46
46
|
options[:default_path],
|
47
47
|
options[:default_filename],
|
data/lib/bowline/ext/object.rb
CHANGED
data/lib/bowline/generators.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
gem
|
2
|
-
require
|
1
|
+
gem "templater", ">= 0.3.2"
|
2
|
+
require "templater"
|
3
|
+
require "rbconfig"
|
3
4
|
|
4
5
|
module Bowline
|
5
6
|
module Generators #:nodoc: all
|
@@ -22,6 +23,10 @@ module Bowline
|
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
26
|
+
def shebang
|
27
|
+
"#!/usr/bin/env #{RbConfig::CONFIG["RUBY_INSTALL_NAME"]}"
|
28
|
+
end
|
29
|
+
|
25
30
|
def self.source_root
|
26
31
|
File.join(File.dirname(__FILE__), *%w[.. .. templates])
|
27
32
|
end
|
@@ -39,7 +39,7 @@ module Bowline::Generators
|
|
39
39
|
glob! "public/javascripts"
|
40
40
|
glob! "public/stylesheets"
|
41
41
|
|
42
|
-
glob! "script"
|
42
|
+
glob! "script", [nil]
|
43
43
|
|
44
44
|
file :jquery, "../assets/jquery.js", "public/javascripts/jquery.js"
|
45
45
|
file :chainjs, "../assets/jquery.chain.js", "public/javascripts/jquery.chain.js"
|
data/lib/bowline/initializer.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
require
|
1
|
+
require "pathname"
|
2
|
+
require "fileutils"
|
2
3
|
|
3
4
|
module Bowline
|
4
5
|
class << self
|
@@ -263,7 +264,7 @@ module Bowline
|
|
263
264
|
def initialize_windows
|
264
265
|
return unless Bowline::Desktop.enabled?
|
265
266
|
MainWindow.setup
|
266
|
-
MainWindow.
|
267
|
+
MainWindow.title = configuration.name
|
267
268
|
end
|
268
269
|
|
269
270
|
def initialize_trap
|
@@ -275,6 +276,7 @@ module Bowline
|
|
275
276
|
|
276
277
|
def initialize_marshal
|
277
278
|
return unless defined?(SuperModel)
|
279
|
+
FileUtils.mkdir_p(File.dirname(configuration.marshal_path))
|
278
280
|
SuperModel::Marshal.path = configuration.marshal_path
|
279
281
|
SuperModel::Marshal.load
|
280
282
|
at_exit {
|
data/lib/bowline/version.rb
CHANGED
data/templates/Gemfile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# Edit this Gemfile to bundle your application's dependencies.
|
2
2
|
|
3
|
-
gem "rubygems-update"
|
4
|
-
gem "
|
3
|
+
gem "rubygems-update", "= 1.3.5"
|
4
|
+
gem "bundler08"
|
5
5
|
gem "bowline"
|
6
6
|
|
7
7
|
## Bundle the gems you use:
|
8
8
|
# gem "bj"
|
9
9
|
# gem "hpricot", "0.6"
|
10
|
-
# gem "sqlite3-ruby", :require_as => "sqlite3"
|
10
|
+
# gem "sqlite3-ruby", :require_as => "sqlite3"
|
data/templates/script/build
CHANGED
data/templates/script/console
CHANGED
data/templates/script/generate
CHANGED
data/templates/script/init
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
<%= shebang %>
|
2
2
|
require File.join(*%w[config environment])
|
data/templates/script/run
CHANGED
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bowline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 6
|
8
|
+
- 2
|
9
|
+
version: 0.6.2
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Alex MacCaw
|
@@ -9,49 +14,64 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-02-
|
17
|
+
date: 2010-02-25 00:00:00 +00:00
|
13
18
|
default_executable: bowline-gen
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: templater
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 3
|
30
|
+
- 2
|
23
31
|
version: 0.3.2
|
24
|
-
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
- !ruby/object:Gem::Dependency
|
26
35
|
name: activesupport
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
38
|
requirements:
|
31
39
|
- - ">="
|
32
40
|
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 3
|
43
|
+
- 0
|
44
|
+
- 0
|
45
|
+
- beta
|
33
46
|
version: 3.0.0.beta
|
34
|
-
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
35
49
|
- !ruby/object:Gem::Dependency
|
36
50
|
name: rubyzip2
|
37
|
-
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
53
|
requirements:
|
41
54
|
- - ">="
|
42
55
|
- !ruby/object:Gem::Version
|
56
|
+
segments:
|
57
|
+
- 2
|
58
|
+
- 0
|
59
|
+
- 1
|
43
60
|
version: 2.0.1
|
44
|
-
|
61
|
+
type: :runtime
|
62
|
+
version_requirements: *id003
|
45
63
|
- !ruby/object:Gem::Dependency
|
46
64
|
name: supermodel
|
47
|
-
|
48
|
-
|
49
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
prerelease: false
|
66
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
67
|
requirements:
|
51
68
|
- - ">="
|
52
69
|
- !ruby/object:Gem::Version
|
70
|
+
segments:
|
71
|
+
- 0
|
53
72
|
version: "0"
|
54
|
-
|
73
|
+
type: :runtime
|
74
|
+
version_requirements: *id004
|
55
75
|
description: Ruby/JS GUI framework
|
56
76
|
email: alex@leadthinking.com
|
57
77
|
executables:
|
@@ -109,6 +129,7 @@ files:
|
|
109
129
|
- lib/bowline/desktop/js.rb
|
110
130
|
- lib/bowline/desktop/misc.rb
|
111
131
|
- lib/bowline/desktop/network.rb
|
132
|
+
- lib/bowline/desktop/path.rb
|
112
133
|
- lib/bowline/desktop/proxy.rb
|
113
134
|
- lib/bowline/desktop/runtime.rb
|
114
135
|
- lib/bowline/desktop/sound.rb
|
@@ -164,7 +185,7 @@ has_rdoc: true
|
|
164
185
|
homepage: http://github.com/maccman/bowline
|
165
186
|
licenses: []
|
166
187
|
|
167
|
-
post_install_message:
|
188
|
+
post_install_message: " **************************************************\n\n Thank you for installing Bowline.\n \n If you're on Linux, please install the WebKit library:\n sudo apt-get install libwebkit-dev\n\n **************************************************\n"
|
168
189
|
rdoc_options:
|
169
190
|
- --charset=UTF-8
|
170
191
|
require_paths:
|
@@ -173,18 +194,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
173
194
|
requirements:
|
174
195
|
- - ">="
|
175
196
|
- !ruby/object:Gem::Version
|
197
|
+
segments:
|
198
|
+
- 0
|
176
199
|
version: "0"
|
177
|
-
version:
|
178
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
201
|
requirements:
|
180
202
|
- - ">="
|
181
203
|
- !ruby/object:Gem::Version
|
204
|
+
segments:
|
205
|
+
- 0
|
182
206
|
version: "0"
|
183
|
-
version:
|
184
207
|
requirements: []
|
185
208
|
|
186
209
|
rubyforge_project:
|
187
|
-
rubygems_version: 1.3.
|
210
|
+
rubygems_version: 1.3.6
|
188
211
|
signing_key:
|
189
212
|
specification_version: 3
|
190
213
|
summary: Bowline GUI framework
|