maccman-bowline 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/bowline.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{bowline}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Alex MacCaw"]
@@ -1,10 +1,9 @@
1
- class TwitterBinder < Bowline::Collection
2
- class << self
3
- # What about filters - should they be implemented?
4
- cattr_accessor :user, :pass
5
-
1
+ class TwitterBinder < Bowline::Binders::Collection
2
+ cattr_accessor :user, :pass
3
+
4
+ class << self
6
5
  def index
7
- self.items = twit.timeline(:user)
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::Base.new(self.user, self.pass)
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
@@ -1,4 +1,4 @@
1
- exec_path = File.join(APP_ROOT, 'build', 'osx', 'testapp.app')
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', 'testapp')}`
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
- glob! "script"
29
- glob! "public"
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"
@@ -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, 'testapp.app', 'Contents')
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
- # todo MacOS
19
- # FileUtils.cp_r('installer', build_path)
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>testapp</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
@@ -1,5 +1,5 @@
1
1
  module Bowline
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
 
4
4
  # The raw JavaScript window object
5
5
  def self.js
@@ -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
- if defined?(Titanium)
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
 
@@ -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(File.dirname(__FILE__), *%w[.. config environment])
18
+ require File.join(*%w[config environment])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maccman-bowline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex MacCaw