powder 0.3.0.pre4 → 0.3.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: de83ef5a6b218c71e71c9a79b8231732a645178b
4
- data.tar.gz: 414b1caa88fb2d4a3958a57a4f24f4e3fcc7a01b
3
+ metadata.gz: ac798e222c9b018fedf3b22a706502cabcef8016
4
+ data.tar.gz: 74a5878bb50db929e7ba4d3c62155a7bb52bf0c3
5
5
  SHA512:
6
- metadata.gz: 986a5d53c6773bac1a603440d0167be9c9d1759fccb12efe72f39a5569c229af5beb02d1e9f2df49b6b851bfd45d65a4fbecb5f53339abd3ffb408b875d8e176
7
- data.tar.gz: 59e56d01b063789f3da56ad87ea906ea9a3f6babc83b54090ef40a77140377316d0e0cf73a6598a17913e7630e448543f8c6cd4b076b48986035f0bc871adc13
6
+ metadata.gz: a633242dab35c250901cbfe2073b0fe24df89e625adf60f66de7ef8643b6587aa6a93855942591056e68b10990fca40f29af7d63e98a4599e7b8eb63fbf98e7a
7
+ data.tar.gz: 6b9f222900fd9165f6e07e8c6e823e770b8bb781daac908435eb90592c480d27229c288f46c404d6942ce3669da24618a1731691fee24b54578b63fe7b981b10
@@ -1,11 +1,10 @@
1
- ### 0.3.0.pre / 2014-10-22 ###
1
+ ### 0.3.0 / 2014-10-29 ###
2
2
 
3
3
  * 1 minor change
4
4
 
5
- * Support for OS X Yosemite. Pow no longer uses the ipfw firewall,
6
- which was deprecated in OS X 10.9 and removed in 10.10. Port
7
- redirection is now handled by the pf packet filter.
8
- Powder reflects the same changes.
5
+ * Support for OS X Yosemite. Powder reflects the changes in Pow.
6
+ Pow no longer uses the ipfw firewall, which was deprecated in OS X 10.9
7
+ and removed in 10.10.
9
8
 
10
9
  ### 0.2.2 / 2014-10-22 ###
11
10
 
data/bin/powder CHANGED
@@ -76,6 +76,7 @@ module Powder
76
76
  else
77
77
  start_on_mavericks
78
78
  end
79
+ say "Pow has been started."
79
80
  end
80
81
 
81
82
  desc "start", "An alias to up"
@@ -85,32 +86,21 @@ module Powder
85
86
  def down
86
87
  if File.exists? POW_FIREWALL_PLIST_PATH
87
88
  if not %x{sudo launchctl list | grep cx.pow.firewall}.empty?
88
- %x{sudo launchctl unload #{POW_FIREWALL_PLIST_PATH}}
89
+ %x{sudo launchctl unload #{POW_FIREWALL_PLIST_PATH} 2>/dev/null}
89
90
  end
90
91
  end
91
92
 
92
93
  if File.exists? POW_DAEMON_PLIST_PATH
93
- %x{launchctl unload #{POW_DAEMON_PLIST_PATH}}
94
- end
95
-
96
- if MAC_OS_X_MINOR_VERSION < 10
97
- if File.exists? POW_FIREWALL_PLIST_PATH
98
- if ports = File.open(POW_FIREWALL_PLIST_PATH).read.match(/fwd .*?,([\d]+).*?dst-port ([\d]+)/)
99
- http_port, dst_port = ports[1..2]
100
- end
101
- end
102
-
103
- http_port ||= 20559
104
- dst_port ||= 80
105
-
106
- if rule = %x{sudo ipfw show | grep ",#{http_port} .* dst-port #{dst_port} in"}.split.first
107
- %x{sudo ipfw delete #{rule} && sudo sysctl -w net.inet.ip.forwarding=0}
108
- end
94
+ %x{launchctl unload #{POW_DAEMON_PLIST_PATH} 2>/dev/null}
109
95
  end
110
96
 
111
97
  if MAC_OS_X_MINOR_VERSION >= 10
112
- %{sudo pfctl -a "com.apple/250.PowFirewall" -F all}
98
+ stop_on_yosemite
99
+ else
100
+ stop_on_mavericks
113
101
  end
102
+
103
+ say "Pow has been stopped."
114
104
  end
115
105
 
116
106
  desc "stop", "An alias to down"
@@ -535,18 +525,37 @@ module Powder
535
525
 
536
526
  def start_on_yosemite
537
527
  return say "Pow daemon configuration missing." unless File.exists?(POW_DAEMON_PLIST_PATH)
538
- %x{launchctl bootstrap gui/"$UID" #{POW_DAEMON_PLIST_PATH}}
528
+ %x{launchctl bootstrap gui/"$UID" #{POW_DAEMON_PLIST_PATH} 2>/dev/null}
539
529
 
540
- %x{launchctl enable gui/"$UID"/cx.pow.powd}
541
- %x{launchctl kickstart -k gui/"$UID"/cx.pow.powd}
530
+ %x{launchctl enable gui/"$UID"/cx.pow.powd 2>/dev/null}
531
+ %x{launchctl kickstart -k gui/"$UID"/cx.pow.powd 2>/dev/null}
532
+ end
533
+
534
+ def stop_on_yosemite
535
+ %{sudo pfctl -a "com.apple/250.PowFirewall" -F all 2>/dev/null}
542
536
  end
543
537
 
544
538
  def start_on_mavericks
545
539
  return say "Pow firewall configuration missing." unless File.exists?(POW_FIREWALL_PLIST_PATH)
546
- %x{launchctl load #{POW_FIREWALL_PLIST_PATH}}
540
+ %x{launchctl load #{POW_FIREWALL_PLIST_PATH} 2>/dev/null}
547
541
 
548
542
  return say "Pow daemon configuration missing." unless File.exists?(POW_DAEMON_PLIST_PATH)
549
- %x{launchctl load #{POW_DAEMON_PLIST_PATH}}
543
+ %x{launchctl load #{POW_DAEMON_PLIST_PATH} 2>/dev/null}
544
+ end
545
+
546
+ def stop_on_mavericks
547
+ if File.exists? POW_FIREWALL_PLIST_PATH
548
+ if ports = File.open(POW_FIREWALL_PLIST_PATH).read.match(/fwd .*?,([\d]+).*?dst-port ([\d]+)/)
549
+ http_port, dst_port = ports[1..2]
550
+ end
551
+ end
552
+
553
+ http_port ||= 20559
554
+ dst_port ||= 80
555
+
556
+ if rule = %x{sudo ipfw show | grep ",#{http_port} .* dst-port #{dst_port} in"}.split.first
557
+ %x{sudo ipfw delete #{rule} && sudo sysctl -w net.inet.ip.forwarding=0}
558
+ end
550
559
  end
551
560
 
552
561
  end
@@ -1,3 +1,3 @@
1
1
  module Powder
2
- VERSION = "0.3.0.pre4"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: powder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.pre4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil Nash
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-22 00:00:00.000000000 Z
12
+ date: 2014-10-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -74,9 +74,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - ">"
77
+ - - ">="
78
78
  - !ruby/object:Gem::Version
79
- version: 1.3.1
79
+ version: '0'
80
80
  requirements: []
81
81
  rubyforge_project: powder
82
82
  rubygems_version: 2.4.1