maccman-bowline 0.1.1 → 0.1.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/bowline.gemspec +1 -1
- data/examples/twitter_binder.rb +14 -8
- data/lib/bowline/commands/run.rb +2 -2
- data/lib/bowline/generators/application.rb +4 -2
- data/lib/bowline/tasks/app.rake +16 -7
- data/lib/bowline.rb +1 -1
- data/templates/config/boot.rb +1 -9
- data/templates/script/init +8 -1
- metadata +1 -1
data/bowline.gemspec
CHANGED
data/examples/twitter_binder.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
class TwitterBinder < Bowline::Collection
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
class TwitterBinder < Bowline::Binders::Collection
|
2
|
+
cattr_accessor :user, :pass
|
3
|
+
|
4
|
+
class << self
|
6
5
|
def index
|
7
|
-
self.items =
|
6
|
+
self.items = timeline
|
8
7
|
end
|
9
8
|
|
10
9
|
def update(text)
|
@@ -32,9 +31,16 @@ class TwitterBinder < Bowline::Collection
|
|
32
31
|
end
|
33
32
|
|
34
33
|
protected
|
35
|
-
|
36
34
|
def twit
|
37
|
-
Twitter::
|
35
|
+
httpauth = Twitter::HTTPAuth.new(self.user, self.pass)
|
36
|
+
Twitter::Base.new(httpauth)
|
37
|
+
end
|
38
|
+
|
39
|
+
def timeline
|
40
|
+
twit.friends_timeline.collect {|t|
|
41
|
+
t.delete('user')
|
42
|
+
t.to_hash
|
43
|
+
}
|
38
44
|
end
|
39
45
|
end
|
40
46
|
end
|
data/lib/bowline/commands/run.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
exec_path = File.join(APP_ROOT, 'build', 'osx',
|
1
|
+
exec_path = File.join(APP_ROOT, 'build', 'osx', "#{APP_NAME}.app")
|
2
2
|
|
3
3
|
unless File.exist?(exec_path)
|
4
4
|
require 'rake'
|
@@ -7,7 +7,7 @@ unless File.exist?(exec_path)
|
|
7
7
|
end
|
8
8
|
|
9
9
|
if ENV['debug']
|
10
|
-
`open #{File.join(exec_path, 'Contents', 'MacOS',
|
10
|
+
`open #{File.join(exec_path, 'Contents', 'MacOS', APP_NAME)}`
|
11
11
|
else
|
12
12
|
`open #{exec_path}`
|
13
13
|
end
|
@@ -25,8 +25,10 @@ module Bowline::Generators
|
|
25
25
|
|
26
26
|
file :gitignore, "gitignore", ".gitignore"
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
empty_directory :public, "public"
|
29
|
+
file :index, "index.html", "index.html"
|
30
|
+
glob! "public/javascripts"
|
31
|
+
glob! "public/stylesheets"
|
30
32
|
|
31
33
|
file :jquery, "../assets/jquery.js", "public/javascripts/jquery.js"
|
32
34
|
file :chainjs, "../assets/jquery.chain.js", "public/javascripts/jquery.chain.js"
|
data/lib/bowline/tasks/app.rake
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
namespace :app do
|
3
3
|
desc "Bundles up app into executables"
|
4
|
-
task :bundle do
|
4
|
+
task :bundle => :environment do
|
5
5
|
build_path = File.join(APP_ROOT, 'build')
|
6
6
|
titanium_path = ENV['TIPATH']
|
7
7
|
raise 'You need to provide TIPATH' unless titanium_path
|
@@ -11,15 +11,18 @@ namespace :app do
|
|
11
11
|
build_path = File.join(build_path, 'osx')
|
12
12
|
FileUtils.rm_rf(build_path)
|
13
13
|
|
14
|
-
build_path = File.join(build_path,
|
14
|
+
build_path = File.join(build_path, "#{APP_NAME}.app", 'Contents')
|
15
15
|
FileUtils.mkdir_p(build_path)
|
16
16
|
|
17
|
+
exec_path = File.join(build_path, 'MacOS')
|
18
|
+
FileUtils.mkdir_p(exec_path)
|
19
|
+
|
17
20
|
FileUtils.cd(titanium_path) do
|
18
|
-
|
19
|
-
|
21
|
+
FileUtils.cp_r('runtime/template/kboot', File.join(exec_path, APP_NAME))
|
22
|
+
FileUtils.cp_r('runtime/installer', build_path)
|
20
23
|
FileUtils.cp_r('modules', build_path)
|
21
24
|
FileUtils.cp_r('runtime', build_path)
|
22
|
-
# FileUtils.cp_r('Frameworks', build_path)
|
25
|
+
# FileUtils.cp_r('Frameworks', build_path) # todo
|
23
26
|
end
|
24
27
|
|
25
28
|
File.open(File.join(build_path, 'Info.plist'), 'w+') do |f|
|
@@ -31,7 +34,7 @@ namespace :app do
|
|
31
34
|
<key>CFBundleDevelopmentRegion</key>
|
32
35
|
<string>English</string>
|
33
36
|
<key>CFBundleExecutable</key>
|
34
|
-
<string
|
37
|
+
<string>#{APP_NAME}</string>
|
35
38
|
<key>CFBundleIconFile</key>
|
36
39
|
<string>titanium.icns</string>
|
37
40
|
<key>CFBundleIdentifier</key>
|
@@ -58,8 +61,14 @@ namespace :app do
|
|
58
61
|
resources_path = File.join(build_path, 'Resources')
|
59
62
|
FileUtils.mkdir_p(resources_path)
|
60
63
|
|
64
|
+
english_path = File.join(resources_path, 'English.lproj')
|
65
|
+
FileUtils.mkdir_p(english_path)
|
66
|
+
FileUtils.cd(build_path) do
|
67
|
+
FileUtils.cp_r('runtime/template/MainMenu.nib', english_path)
|
68
|
+
FileUtils.cp_r('runtime/template/titanium.icns', english_path)
|
69
|
+
end
|
70
|
+
|
61
71
|
dirs = Dir[File.join(APP_ROOT, '*')] - [File.join(APP_ROOT, 'build')]
|
62
|
-
|
63
72
|
FileUtils.cp_r(dirs, resources_path)
|
64
73
|
|
65
74
|
FileUtils.cd(resources_path) do
|
data/lib/bowline.rb
CHANGED
data/templates/config/boot.rb
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
# Don't change this file!
|
2
2
|
# Configure your app in config/environment.rb and config/environments/*.rb
|
3
3
|
|
4
|
-
|
5
|
-
# Hack for load paths - Titanium doesn't add .
|
6
|
-
app_resources = Titanium.App.appURLToPath("app://index.html")
|
7
|
-
APP_ROOT = File.dirname(app_resources)
|
8
|
-
else
|
9
|
-
APP_ROOT = File.join(File.dirname(__FILE__), "..")
|
10
|
-
end
|
11
|
-
$LOAD_PATH << APP_ROOT
|
12
|
-
$LOAD_PATH.uniq!
|
4
|
+
APP_ROOT = File.join(File.dirname(__FILE__), "..") unless defined?(APP_ROOT)
|
13
5
|
|
14
6
|
bowline_path = File.join(APP_ROOT, *%w[vendor bowline lib bowline.rb])
|
15
7
|
|
data/templates/script/init
CHANGED
@@ -4,8 +4,15 @@ unless defined?(Titanium)
|
|
4
4
|
raise "You can't execute this file directly - it's for Titanium"
|
5
5
|
end
|
6
6
|
|
7
|
+
# Hack for load paths - Titanium doesn't add .
|
8
|
+
app_resources = Titanium.App.appURLToPath("app://index.html")
|
9
|
+
APP_ROOT = File.dirname(app_resources)
|
10
|
+
|
11
|
+
$LOAD_PATH << APP_ROOT
|
12
|
+
$LOAD_PATH.uniq!
|
13
|
+
|
7
14
|
# The 'window' function is only
|
8
15
|
# available in this scope
|
9
16
|
$app_window = window
|
10
17
|
|
11
|
-
require File.join(
|
18
|
+
require File.join(*%w[config environment])
|