bowline 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bowline.gemspec +1 -1
- data/lib/bowline/initializer.rb +2 -2
- data/lib/bowline/library.rb +20 -2
- data/lib/bowline/tasks/libs.rake +26 -3
- data/lib/bowline/version.rb +1 -1
- data/templates/config/boot.rb +4 -12
- data/templates/public/index.html +1 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
data/bowline.gemspec
CHANGED
data/lib/bowline/initializer.rb
CHANGED
@@ -59,6 +59,7 @@ module Bowline
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def initialize_ruby
|
62
|
+
return unless Bowline::Desktop.enabled?
|
62
63
|
ruby_path = File.join(configuration.rubylib_path)
|
63
64
|
unless File.directory?(ruby_path)
|
64
65
|
ruby_path = Bowline::Library.rubylib_path
|
@@ -78,7 +79,7 @@ module Bowline
|
|
78
79
|
require File.join(*%w[enc trans transdb])
|
79
80
|
$:.uniq!
|
80
81
|
end
|
81
|
-
|
82
|
+
|
82
83
|
def require_frameworks
|
83
84
|
configuration.frameworks.each { |framework| require(framework.to_s) }
|
84
85
|
end
|
@@ -192,7 +193,6 @@ module Bowline
|
|
192
193
|
end
|
193
194
|
|
194
195
|
def initialize_gems
|
195
|
-
require 'rubygems'
|
196
196
|
Gem.clear_paths
|
197
197
|
Gem.path.unshift(configuration.gem_path)
|
198
198
|
end
|
data/lib/bowline/library.rb
CHANGED
@@ -8,7 +8,7 @@ module Bowline
|
|
8
8
|
|
9
9
|
def path
|
10
10
|
File.expand_path(
|
11
|
-
File.join(
|
11
|
+
File.join(home_path, ".bowline")
|
12
12
|
)
|
13
13
|
end
|
14
14
|
module_function :path
|
@@ -24,8 +24,26 @@ module Bowline
|
|
24
24
|
module_function :rubylib_path
|
25
25
|
|
26
26
|
def downloaded?
|
27
|
-
File.exist?(desktop_path) &&
|
27
|
+
File.exist?(desktop_path) &&
|
28
|
+
File.directory?(rubylib_path)
|
28
29
|
end
|
29
30
|
module_function :downloaded?
|
31
|
+
|
32
|
+
private
|
33
|
+
# Borrowed from Rubygems
|
34
|
+
def home_path
|
35
|
+
['HOME', 'USERPROFILE'].each do |homekey|
|
36
|
+
return ENV[homekey] if ENV[homekey]
|
37
|
+
end
|
38
|
+
if ENV['HOMEDRIVE'] && ENV['HOMEPATH'] then
|
39
|
+
return "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}"
|
40
|
+
end
|
41
|
+
begin
|
42
|
+
File.expand_path("~")
|
43
|
+
rescue
|
44
|
+
File::ALT_SEPARATOR ? "C:/" : "/"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
module_function :home_path
|
30
48
|
end
|
31
49
|
end
|
data/lib/bowline/tasks/libs.rake
CHANGED
@@ -24,7 +24,30 @@ def download(url)
|
|
24
24
|
end
|
25
25
|
|
26
26
|
namespace :libs do
|
27
|
-
|
27
|
+
# Lots of people are using Ruby 1.8 with Bowline.
|
28
|
+
# When bowline-desktop loads, it doesn't know where the
|
29
|
+
# Bowline gem is if it's an 1.8 gem dir. So, we just symlink
|
30
|
+
# it to vendor/bowline. One caveat though, is that you have to
|
31
|
+
# re-run this task when you update the gem.
|
32
|
+
task :symlink_bowline => :environment do
|
33
|
+
local_path = File.join(APP_ROOT, "vendor", "bowline")
|
34
|
+
unless File.directory?(local_path)
|
35
|
+
begin
|
36
|
+
FileUtils.ln_s(
|
37
|
+
Bowline.lib_path,
|
38
|
+
bowline_path
|
39
|
+
)
|
40
|
+
rescue NotImplemented
|
41
|
+
FileUtils.cp_r(
|
42
|
+
Bowline.lib_path,
|
43
|
+
bowline_path
|
44
|
+
)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
desc "Download Bowline's binary and pre-compiled libs"
|
50
|
+
task :download => [:environment, :symlink_bowline] do
|
28
51
|
puts "Downloading libraries. This may take a while..."
|
29
52
|
FileUtils.mkdir_p(Bowline::Library.path)
|
30
53
|
|
@@ -51,9 +74,9 @@ namespace :libs do
|
|
51
74
|
puts "Finished downloading"
|
52
75
|
end
|
53
76
|
|
77
|
+
desc "Update Bowline's binary and pre-compiled libs"
|
54
78
|
task :update => :environment do
|
55
|
-
FileUtils.rm_rf(Bowline::Library.
|
56
|
-
FileUtils.rm_rf(Bowline::Library.rubylib_path)
|
79
|
+
FileUtils.rm_rf(Bowline::Library.path)
|
57
80
|
Rake::Task["libs:download"].invoke
|
58
81
|
end
|
59
82
|
end
|
data/lib/bowline/version.rb
CHANGED
data/templates/config/boot.rb
CHANGED
@@ -1,19 +1,11 @@
|
|
1
1
|
# Don't change this file!
|
2
|
-
# Configure your app in config/environment.rb
|
2
|
+
# Configure your app in config/environment.rb
|
3
3
|
|
4
4
|
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), "..")) unless defined?(APP_ROOT)
|
5
|
+
local_path = File.join(APP_ROOT, *%w{vendor bowline lib bowline.rb})
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
if File.exist?(edge_path)
|
9
|
-
bowline_path = edge_path
|
10
|
-
else
|
11
|
-
gems_path = File.join(APP_ROOT, *%w{vendor gems gems})
|
12
|
-
bowline_path = Dir[File.join(gems_path, *%w{{maccman-bowline*,bowline*} lib bowline.rb})][-1]
|
13
|
-
end
|
14
|
-
|
15
|
-
if bowline_path
|
16
|
-
require bowline_path
|
7
|
+
if File.exist?(local_path)
|
8
|
+
require local_path
|
17
9
|
else
|
18
10
|
require "rubygems"
|
19
11
|
require "bowline"
|
data/templates/public/index.html
CHANGED