whereuat 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -23,16 +23,30 @@ Use the following helper somewhere in your application layout (we recommend at t
23
23
 
24
24
  = whereuat
25
25
 
26
- If you're using Rails 3, tell it the HTML is safe
27
-
28
- = whereuat.html_safe
29
-
30
26
  The helper will insert a smidgeon of javascript that will add a tiny tab on the LHS of each page.
31
27
 
32
28
  **Please note** that whereuat requires `jQuery` to be included in your layout or templates already.
33
29
 
34
30
  Reload a page from your app and give it a whirl.
35
31
 
32
+ ### Installing assets
33
+
34
+ By default, whereuat's assets are served as raw blobs from Github. Sometimes you'd rather serve them from within your app.
35
+
36
+ In Rails 3, after whereuat configuration above, its as simple as
37
+
38
+ rake whereuat:install
39
+
40
+ In Rails 2, you need to create a `RAILS_ROOT/lib/tasks/whereuat.rake`
41
+ require 'whereuat/tasks'
42
+
43
+ then
44
+ rake whereuat:install
45
+
46
+ (You can always copy the assets in the gem over by hand)
47
+
48
+ **Please note** image assets are served from PLUS2's server at `conversant.com.au`. Configurable image urls are coming in a later version but for now please edit the paths manually.
49
+
36
50
  ## Note on Patches/Pull Requests
37
51
 
38
52
  * Fork the project.
@@ -51,4 +65,4 @@ Reload a page from your app and give it a whirl.
51
65
 
52
66
  ## Copyright
53
67
 
54
- Copyright (c) 2010 Plus2. See LICENSE for details.
68
+ Copyright © 2010 Plus2. See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.11
1
+ 0.0.12
@@ -8,14 +8,25 @@ module Whereuat
8
8
  attr_accessor :whereuat_javascript_url
9
9
 
10
10
  def initialize
11
+ if Whereuat.assets_path.directory?
12
+ use_internal_resources!
13
+ else
14
+ use_github_resources!
15
+ end
16
+ end
17
+
18
+ def use_github_resources!
19
+ puts "using github resources"
11
20
  self.whereuat_stylesheet_url = "http://github.com/plus2/whereuat/raw/master/lib/whereuat/stylesheets/whereuat.css"
12
21
  self.whereuat_javascript_url = "http://github.com/plus2/whereuat/raw/master/lib/whereuat/javascript/whereuat.js"
13
22
  end
14
23
 
15
- def use_dev_resources!
24
+ def use_internal_resources!
25
+ puts "using internal resources"
16
26
  self.whereuat_stylesheet_url = "/whereuat/whereuat.css"
17
27
  self.whereuat_javascript_url = "/whereuat/whereuat.js"
18
28
  end
29
+ alias :use_dev_resources! :use_internal_resources!
19
30
  end
20
31
 
21
32
  end
@@ -1,8 +1,10 @@
1
1
  module Whereuat
2
2
  module Helpers
3
3
  def whereuat
4
- "<script type='text/javascript'>var whereuat_stylesheet_url=#{Whereuat.configuration.whereuat_stylesheet_url.to_json};</script>" +
5
- "<script type='text/javascript' src='#{Whereuat.configuration.whereuat_javascript_url}'></script>"
4
+ wua = "<script type='text/javascript'>var whereuat_stylesheet_url=#{Whereuat.configuration.whereuat_stylesheet_url.to_json};</script>" +
5
+ "<script type='text/javascript' src='#{Whereuat.configuration.whereuat_javascript_url}'></script>"
6
+
7
+ wua.respond_to?(:html_safe) ? wua.html_safe : wua
6
8
  end
7
9
  end
8
10
  end
@@ -3,5 +3,8 @@ module Whereuat
3
3
  initializer 'whereuat.middleware' do |app|
4
4
  app.config.middleware.insert_after(ActionDispatch::Static, Whereuat::RackApp)
5
5
  end
6
+ rake_tasks do
7
+ Whereuat.load_rake_tasks!
8
+ end
6
9
  end
7
10
  end
@@ -0,0 +1,13 @@
1
+ namespace :whereuat do
2
+ desc "install whereuat's image, js & css assets into the app's public directory, for faster serving"
3
+ task :install do
4
+ Whereuat.assets_path.mkpath
5
+
6
+ lib = Whereuat.gem_root+'lib/whereuat'
7
+
8
+ FileList[lib+'javascript/*.js', lib+'stylesheets/*'].each do |path|
9
+ to = Whereuat.assets_path + File.basename(path)
10
+ cp path, to
11
+ end
12
+ end
13
+ end
data/lib/whereuat.rb CHANGED
@@ -14,5 +14,17 @@ module Whereuat
14
14
  def configure
15
15
  yield(configuration)
16
16
  end
17
+
18
+ def load_rake_tasks!
19
+ load gem_root+'lib/whereuat/tasks.rb'
20
+ end
21
+
22
+ def assets_path
23
+ Rails.root+'public/whereuat'
24
+ end
25
+
26
+ def gem_root
27
+ @gem_root ||= Pathname('../..').expand_path(__FILE__)
28
+ end
17
29
  end
18
30
  end
data/whereuat.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{whereuat}
8
- s.version = "0.0.11"
8
+ s.version = "0.0.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ben Askins", "Lachie Cox", "Ben Webster"]
12
- s.date = %q{2010-08-09}
12
+ s.date = %q{2010-08-11}
13
13
  s.description = %q{Adds a toolbar to your rails app that directs your clients to test stories that have been marked as 'delivered' in Pivotal Tracker }
14
14
  s.email = %q{ben.askins@plus2.com.au}
15
15
  s.extra_rdoc_files = [
@@ -37,6 +37,7 @@ Gem::Specification.new do |s|
37
37
  "lib/whereuat/stylesheets/whereuat-open.png",
38
38
  "lib/whereuat/stylesheets/whereuat.css",
39
39
  "lib/whereuat/stylesheets/whereuat.png",
40
+ "lib/whereuat/tasks.rb",
40
41
  "lib/whereuat/templates/index.haml",
41
42
  "whereuat.gemspec"
42
43
  ]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 11
9
- version: 0.0.11
8
+ - 12
9
+ version: 0.0.12
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ben Askins
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-08-09 00:00:00 +10:00
19
+ date: 2010-08-11 00:00:00 +10:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -91,6 +91,7 @@ files:
91
91
  - lib/whereuat/stylesheets/whereuat-open.png
92
92
  - lib/whereuat/stylesheets/whereuat.css
93
93
  - lib/whereuat/stylesheets/whereuat.png
94
+ - lib/whereuat/tasks.rb
94
95
  - lib/whereuat/templates/index.haml
95
96
  - whereuat.gemspec
96
97
  has_rdoc: true