bowline 0.5.1 → 0.5.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/VERSION +1 -1
- data/bowline.gemspec +1 -1
- data/lib/bowline/commands/build.rb +0 -1
- data/lib/bowline/commands/run.rb +2 -3
- data/lib/bowline/generators/application.rb +1 -1
- data/lib/bowline/library.rb +9 -3
- data/lib/bowline/tasks/app.rake +2 -2
- data/lib/bowline/tasks/bowline.rb +3 -0
- data/lib/bowline/tasks/libs.rake +25 -19
- data/lib/bowline/version.rb +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.2
|
data/bowline.gemspec
CHANGED
data/lib/bowline/commands/run.rb
CHANGED
@@ -50,7 +50,7 @@ module Bowline::Generators
|
|
50
50
|
empty_directory :binders, "app/binders"
|
51
51
|
empty_directory :helpers, "app/helpers"
|
52
52
|
empty_directory :windows, "app/windows"
|
53
|
-
file :mainwindow, "main_window.rb", "app/windows"
|
53
|
+
file :mainwindow, "main_window.rb", "app/windows/main_window.rb"
|
54
54
|
|
55
55
|
empty_directory :config, "config"
|
56
56
|
template :environment, "config/environment.rb", "config/environment.rb"
|
data/lib/bowline/library.rb
CHANGED
@@ -23,11 +23,17 @@ module Bowline
|
|
23
23
|
end
|
24
24
|
module_function :rubylib_path
|
25
25
|
|
26
|
-
def
|
26
|
+
def bowline_path
|
27
|
+
File.join(APP_ROOT, "vendor", "bowline")
|
28
|
+
end
|
29
|
+
module_function :bowline_path
|
30
|
+
|
31
|
+
def ready?
|
27
32
|
File.exist?(desktop_path) &&
|
28
|
-
File.directory?(rubylib_path)
|
33
|
+
File.directory?(rubylib_path) &&
|
34
|
+
File.directory?(bowline_path)
|
29
35
|
end
|
30
|
-
module_function :
|
36
|
+
module_function :ready?
|
31
37
|
|
32
38
|
private
|
33
39
|
# Borrowed from Rubygems
|
data/lib/bowline/tasks/app.rake
CHANGED
@@ -5,8 +5,8 @@ require 'rbconfig'
|
|
5
5
|
namespace :app do
|
6
6
|
namespace :build do
|
7
7
|
task :osx => :environment do
|
8
|
-
unless Bowline::Library.
|
9
|
-
Rake::Task["libs:
|
8
|
+
unless Bowline::Library.ready?
|
9
|
+
Rake::Task["libs:setup"].invoke
|
10
10
|
end
|
11
11
|
|
12
12
|
config = Bowline.configuration
|
data/lib/bowline/tasks/libs.rake
CHANGED
@@ -11,7 +11,7 @@ def download(url)
|
|
11
11
|
req = Net::HTTP::Get.new(url.path)
|
12
12
|
res = Net::HTTP.start(url.host, url.port) {|http|
|
13
13
|
http.request(req) {|resp|
|
14
|
-
pbar = ProgressBar.new(
|
14
|
+
pbar = ProgressBar.new("Downloading...", resp.content_length)
|
15
15
|
resp.read_body {|seg|
|
16
16
|
pbar.inc(seg.length)
|
17
17
|
file.write(seg)
|
@@ -23,35 +23,45 @@ def download(url)
|
|
23
23
|
file
|
24
24
|
end
|
25
25
|
|
26
|
+
def unzip(fpath, tpath)
|
27
|
+
Zip::ZipFile.open(fpath) { |zfile|
|
28
|
+
zfile.each {|file|
|
29
|
+
file_path = File.join(tpath, file.name)
|
30
|
+
FileUtils.mkdir_p(File.dirname(file_path))
|
31
|
+
zfile.extract(file, file_path)
|
32
|
+
}
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
26
36
|
namespace :libs do
|
27
37
|
# Lots of people are using Ruby 1.8 with Bowline.
|
28
38
|
# When bowline-desktop loads, it doesn't know where the
|
29
39
|
# Bowline gem is if it's an 1.8 gem dir. So, we just symlink
|
30
40
|
# it to vendor/bowline. One caveat though, is that you have to
|
31
41
|
# re-run this task when you update the gem.
|
32
|
-
task :
|
33
|
-
local_path =
|
42
|
+
task :unpack => :environment do
|
43
|
+
local_path = Bowline::Library.bowline_path
|
34
44
|
unless File.directory?(local_path)
|
35
45
|
begin
|
36
46
|
FileUtils.ln_s(
|
37
47
|
Bowline.lib_path,
|
38
|
-
|
48
|
+
local_path
|
39
49
|
)
|
40
|
-
rescue
|
50
|
+
rescue NotImplementedError
|
41
51
|
FileUtils.cp_r(
|
42
52
|
Bowline.lib_path,
|
43
|
-
|
53
|
+
local_path
|
44
54
|
)
|
45
55
|
end
|
46
56
|
end
|
47
57
|
end
|
48
58
|
|
49
59
|
desc "Download Bowline's binary and pre-compiled libs"
|
50
|
-
task :download =>
|
51
|
-
puts "Downloading libraries. This may take a while..."
|
60
|
+
task :download => :environment do
|
52
61
|
FileUtils.mkdir_p(Bowline::Library.path)
|
53
|
-
|
54
62
|
desktop_path = Bowline::Library.desktop_path
|
63
|
+
rubylib_path = Bowline::Library.rubylib_path
|
64
|
+
|
55
65
|
unless File.exist?(desktop_path)
|
56
66
|
desktop_tmp = download(Bowline::Library::DESKTOP_URL)
|
57
67
|
desktop_tmp.close
|
@@ -59,24 +69,20 @@ namespace :libs do
|
|
59
69
|
FileUtils.chmod(0755, desktop_path)
|
60
70
|
end
|
61
71
|
|
62
|
-
unless File.directory?(
|
72
|
+
unless File.directory?(rubylib_path)
|
63
73
|
rubylib_tmp = download(Bowline::Library::RUBYLIB_URL)
|
64
74
|
rubylib_tmp.close
|
65
75
|
puts "Extracting..."
|
66
|
-
|
67
|
-
zfile.each {|file|
|
68
|
-
file_path = File.join(Bowline::Library.path, file.name)
|
69
|
-
FileUtils.mkdir_p(File.dirname(file_path))
|
70
|
-
zfile.extract(file, file_path)
|
71
|
-
}
|
72
|
-
}
|
76
|
+
unzip(rubylib_tmp.path, Bowline::Library.path)
|
73
77
|
end
|
74
|
-
puts "Finished downloading"
|
75
78
|
end
|
79
|
+
|
80
|
+
task :setup => [:environment, "gems:sync", "libs:unpack", "libs:download"]
|
76
81
|
|
77
82
|
desc "Update Bowline's binary and pre-compiled libs"
|
78
83
|
task :update => :environment do
|
79
84
|
FileUtils.rm_rf(Bowline::Library.path)
|
80
|
-
|
85
|
+
FileUtils.rm_rf(Bowline::Library.bowline_path)
|
86
|
+
Rake::Task["libs:setup"].invoke
|
81
87
|
end
|
82
88
|
end
|
data/lib/bowline/version.rb
CHANGED