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 CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bowline}
8
- s.version = "0.5.0"
8
+ s.version = "0.5.1"
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"]
@@ -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
@@ -8,7 +8,7 @@ module Bowline
8
8
 
9
9
  def path
10
10
  File.expand_path(
11
- File.join(Gem.user_home, ".bowline")
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) && File.directory?(rubylib_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
@@ -24,7 +24,30 @@ def download(url)
24
24
  end
25
25
 
26
26
  namespace :libs do
27
- task :download => :environment do
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.desktop_path)
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
@@ -2,7 +2,7 @@ module Bowline
2
2
  module Version #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
 
@@ -1,19 +1,11 @@
1
1
  # Don't change this file!
2
- # Configure your app in config/environment.rb and config/environments/*.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
- edge_path = File.join(APP_ROOT, *%w{vendor bowline lib bowline.rb})
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"
@@ -20,5 +20,6 @@
20
20
  </script>
21
21
  </head>
22
22
  <body>
23
+ <h1>Hello World from Bowline</h1>
23
24
  </body>
24
25
  </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bowline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex MacCaw