pave 0.10.1 → 0.11.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb24e6e597843c89fac5966ab4ff7aa84c39c374
4
- data.tar.gz: e83b5a8d7ba9daa544f4a37c5fbeceb99cb20501
3
+ metadata.gz: 108b4f06d5dbc9c4ea6826a33f7bad0985aeb56a
4
+ data.tar.gz: 1497b2188235137f1c7481c7fd680672d0aa75bb
5
5
  SHA512:
6
- metadata.gz: 8ce93b4e77b114c964be21180e0b23fc25a8b21c7d2217032ea2fb11fd6c2f21bd4c30aa53af2cff0bdce744a307355298fe159dd01975078833f1857f68530f
7
- data.tar.gz: 0a1e42502cbe7d084aeeb2c0f08fe155965a1f93c8dfb7cf94fa06bed8d5110169a5032a6c408d86c55aee9cdc0546d5582f0ff93f99dc7c3e7380212106b977
6
+ metadata.gz: 7215e18152be68bf34ff19170bbc8084afbd2bd57f191b10e9db284a027774ff5a2989de91b6f269c47971a3bdd1bea39bbc581aa2e24ee2c589d0a75fe20f01
7
+ data.tar.gz: 2a7cfdaf9e2a0c0acd02453445a90d3358c9c8027cb6090d0cbd974572769ed0601d6e59e20c6f933c3607117a4537d79ac77ab022e253dffb537e530fb2c2ab
data/.floo ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "url": "https://floobits.com/jamonholmgren/pave/"
3
+ }
@@ -0,0 +1,4 @@
1
+ extern
2
+ node_modules
3
+ tmp
4
+ vendor
data/bin/pave CHANGED
@@ -251,10 +251,11 @@ end
251
251
  alias_command :"g:theme", :"generate:theme"
252
252
 
253
253
  command :watch do |c|
254
- c.syntax = "pave watch"
254
+ c.syntax = "pave watch BROWSER"
255
255
  c.description = "Watch for sass changes."
256
256
  c.action do |args|
257
- Pave::Theme.watch
257
+ browser = args.first || "chrome"
258
+ Pave::Theme.watch(browser)
258
259
  end
259
260
  end
260
261
 
@@ -277,9 +278,10 @@ command :"deploy:setup" do |c|
277
278
  end
278
279
 
279
280
  command :"livereload" do |c|
280
- c.syntax = "pave livereload"
281
+ c.syntax = "pave livereload BROWSER"
281
282
  c.description = "Watch project for changes and refresh page."
282
283
  c.action do |args|
283
- Pave::Reload.live_reload
284
+ browser = args.first || "chrome"
285
+ Pave::Reload.live_reload(browser)
284
286
  end
285
287
  end
@@ -1,6 +1,6 @@
1
1
  module Pave
2
2
  class Reload
3
- def self.live_reload
3
+ def self.live_reload(browser="chrome")
4
4
  # docs: http://brettterpstra.com/2011/03/07/watch-for-file-changes-and-refresh-your-browser-automatically/
5
5
  trap("SIGINT") { exit }
6
6
 
@@ -19,20 +19,49 @@ module Pave
19
19
  hash = new_hash
20
20
 
21
21
  diff_hash.each do |df|
22
- puts "Detected change in #{df[0]}, refreshing"
23
- %x{osascript<<ENDGAME
24
- tell application "Google Chrome"
25
- set windowList to every window
26
- repeat with aWindow in windowList
27
- set tabList to every tab of aWindow
28
- repeat with atab in tabList
29
- if (URL of atab contains "#{keyword}") then
30
- tell atab to reload
31
- end if
22
+ print "Detected change in #{df[0]}, refreshing"
23
+ if browser == "chrome"
24
+ print " Chrome"
25
+ %x{osascript<<ENDGAME
26
+ tell application "Google Chrome"
27
+ set windowList to every window
28
+ repeat with aWindow in windowList
29
+ set tabList to every tab of aWindow
30
+ repeat with atab in tabList
31
+ if (URL of atab contains "#{keyword}") then
32
+ tell atab to reload
33
+ end if
34
+ end repeat
32
35
  end repeat
33
- end repeat
34
- end tell
35
- }
36
+ end tell
37
+ }
38
+ elsif browser == "safari"
39
+ print " Safari"
40
+ %x{osascript<<ENDGAME
41
+ tell application "Safari"
42
+ set windowList to every window
43
+ repeat with aWindow in windowList
44
+ set tabList to every tab of aWindow
45
+ repeat with atab in tabList
46
+ if (URL of atab contains "#{keyword}") then
47
+ tell atab to set its URL to (get its URL)
48
+ end if
49
+ end repeat
50
+ end repeat
51
+ end tell
52
+ }
53
+ elsif browser == "firefox"
54
+ print " Firefox"
55
+ %x{osascript<<ENDGAME
56
+ tell app "Firefox" to activate
57
+ tell app "System Events"
58
+ keystroke "r" using command down
59
+ end tell
60
+ }
61
+ else
62
+ puts "#{browser} is not supported yet. Feel free to add it and create a pull request!"
63
+ end
64
+ puts ""
36
65
  end
37
66
  end
38
67
 
@@ -8,8 +8,8 @@ module Pave
8
8
  new(name).setup
9
9
  end
10
10
 
11
- def self.watch
12
- system("pave livereload &")
11
+ def self.watch(browser)
12
+ system("pave livereload #{browser} &")
13
13
  system("sass --watch ./themes/ --style compressed")
14
14
  end
15
15
 
@@ -1,3 +1,3 @@
1
1
  module Pave
2
- VERSION = "0.10.1"
2
+ VERSION = "0.11.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pave
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamon Holmgren
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-14 00:00:00.000000000 Z
12
+ date: 2014-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -90,6 +90,8 @@ executables:
90
90
  extensions: []
91
91
  extra_rdoc_files: []
92
92
  files:
93
+ - ".floo"
94
+ - ".flooignore"
93
95
  - ".gitignore"
94
96
  - ".ruby-gemset"
95
97
  - ".ruby-version"