motion-sparkle 0.0.2 → 0.0.3
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 +8 -8
- data/lib/motion/project/setup.rb +1 -0
- data/lib/motion/project/sparkle.rb +21 -1
- data/lib/motion/project/version.rb +1 -1
- data/spec/sparkle_spec.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTIxZWYzYTgzZGZlNWU0YzE0YjE4YzUyYzY5ODFlYTk4NzBmYWE4MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2IwNWRlNmZmYTZlOGZjY2U3Y2ZlZTBmOTBkOWRhMDJkOWZjMTcyOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzBmY2QxMzE2YTVlYzUxNDkwNzliOTYwYmFjM2MzNWQ1Zjc0ZDlkOTgwYmQ1
|
10
|
+
YWM3OGJlOWM2MjcyYmFhNGY2ZjY0OGI5ZTA3ZmJkNjUxZTQxMmU0MDNlNzEz
|
11
|
+
NjE4NjdlN2VjN2ZlYjk3ZTIxOTVlODgzMzYxOTVmYjA0NGVjMTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTRjMjMzZDI4ZDJkODY0YzY2OGFiMDg2NmExNmI1ODU4ZTRhYjE3Zjk5ZjQ0
|
14
|
+
NzFiZjU1MWMzOGI3NmFmMjI5ZGI2YjY0MjAzMjViMmU4ZGJhNzljMjM5NTA2
|
15
|
+
OTlkNGNlY2YyZWVmOWRlYjExZmQ2NDcyMGI5N2I2MzcyY2NhNGI=
|
data/lib/motion/project/setup.rb
CHANGED
@@ -63,6 +63,22 @@ module Motion::Project
|
|
63
63
|
|
64
64
|
# File manipulation and certificates
|
65
65
|
|
66
|
+
def add_to_gitignore
|
67
|
+
@ignorable = ['sparkle/release','sparkle/release/*','sparkle/config/dsa_priv.pem']
|
68
|
+
return unless File.exist?(gitignore_path)
|
69
|
+
File.open(gitignore_path, 'r') do |f|
|
70
|
+
f.each_line do |line|
|
71
|
+
@ignorable.delete(line) if @ignorable.include?(line)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
File.open(gitignore_path, 'a') do |f|
|
75
|
+
@ignorable.each do |i|
|
76
|
+
f << "#{i}\n"
|
77
|
+
end
|
78
|
+
end if @ignorable.any?
|
79
|
+
`cat #{gitignore_path}`
|
80
|
+
end
|
81
|
+
|
66
82
|
def create_sparkle_folder
|
67
83
|
create_config_folder
|
68
84
|
create_release_folder
|
@@ -100,7 +116,7 @@ Details:
|
|
100
116
|
* Private certificate: ./#{private_key_path}
|
101
117
|
* Public certificate: ./#{public_key_path}
|
102
118
|
Warning:
|
103
|
-
ADD YOUR PRIVATE CERTIFICATE TO YOUR
|
119
|
+
ADD YOUR PRIVATE CERTIFICATE TO YOUR `.gitignore` OR EQUIVALENT AND BACK IT UP!
|
104
120
|
KEEP IT PRIVATE AND SAFE!
|
105
121
|
If you lose it, your users will be unable to upgrade.
|
106
122
|
"
|
@@ -120,6 +136,10 @@ If you lose it, your users will be unable to upgrade.
|
|
120
136
|
@project_path ||= Pathname.new(@config.project_dir)
|
121
137
|
end
|
122
138
|
|
139
|
+
def gitignore_path
|
140
|
+
project_path + ".gitignore"
|
141
|
+
end
|
142
|
+
|
123
143
|
def sparkle_release_path
|
124
144
|
project_path + RELEASE_PATH
|
125
145
|
end
|
data/spec/sparkle_spec.rb
CHANGED
@@ -13,7 +13,9 @@ describe "motion-sparkle" do
|
|
13
13
|
unless @completed_setup
|
14
14
|
teardown_temporary_directory
|
15
15
|
setup_temporary_directory
|
16
|
+
|
16
17
|
FileUtils.mkdir_p(temporary_directory + 'resources')
|
18
|
+
FileUtils.touch(temporary_directory + '.gitignore')
|
17
19
|
|
18
20
|
@config = App.config
|
19
21
|
@config.project_dir = temporary_directory.to_s
|
@@ -71,4 +73,9 @@ describe "motion-sparkle" do
|
|
71
73
|
File.exist?(@config.sparkle.public_key_path.to_s).should.equal true
|
72
74
|
end
|
73
75
|
|
76
|
+
it "should add files to gitignore" do
|
77
|
+
a = `cat .gitignore`
|
78
|
+
a.strip.should.not.equal ''
|
79
|
+
end
|
80
|
+
|
74
81
|
end
|