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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmIwNjFhMTJjNmNlNTYyZGQwNzNhMjNmZmNiNjA1MTM1Y2EzNzI1Mw==
4
+ NTIxZWYzYTgzZGZlNWU0YzE0YjE4YzUyYzY5ODFlYTk4NzBmYWE4MA==
5
5
  data.tar.gz: !binary |-
6
- YzVjY2U3YmNjNzNiMjkyOTJkMDU3ZDEzNjRlN2QxNTMxMTkyZjBhZg==
6
+ N2IwNWRlNmZmYTZlOGZjY2U3Y2ZlZTBmOTBkOWRhMDJkOWZjMTcyOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTFhMTIwMzkwMmIxODI2MzAzMTAyZDUzNTRkMDU5MWFhM2ZkNmE1YjE4OTgx
10
- YTc1NjRhZGFiMjdkOWU3MzYwYWM3ZWRhM2I2NGEwNWI3NjI0YTJkZDQwMWY5
11
- ZTRjN2JhYjI3Njc4NzZkNDA2NzE3MTgwZDRlZTRkMjM1OTRkYmE=
9
+ MzBmY2QxMzE2YTVlYzUxNDkwNzliOTYwYmFjM2MzNWQ1Zjc0ZDlkOTgwYmQ1
10
+ YWM3OGJlOWM2MjcyYmFhNGY2ZjY0OGI5ZTA3ZmJkNjUxZTQxMmU0MDNlNzEz
11
+ NjE4NjdlN2VjN2ZlYjk3ZTIxOTVlODgzMzYxOTVmYjA0NGVjMTI=
12
12
  data.tar.gz: !binary |-
13
- M2MxYTNiYWQ5ZmFhNjA1ODI0OThkZWI4MGZmN2JlNDljNzY3ZmIyODc0ZGM5
14
- NTY0NTZlNzhmOWE5ZjBhYzRjMWFjMDNkNzhkOWM0M2Y3MDI1MjlmOGI0NWI0
15
- ZjcxYzM5MTE1M2E2NTJhNWMwOTlkMTM0MjBkYWM0Nzc1MzhmMzI=
13
+ ZTRjMjMzZDI4ZDJkODY0YzY2OGFiMDg2NmExNmI1ODU4ZTRhYjE3Zjk5ZjQ0
14
+ NzFiZjU1MWMzOGI3NmFmMjI5ZGI2YjY0MjAzMjViMmU4ZGJhNzljMjM5NTA2
15
+ OTlkNGNlY2YyZWVmOWRlYjExZmQ2NDcyMGI5N2I2MzcyY2NhNGI=
@@ -50,6 +50,7 @@ module Motion::Project
50
50
 
51
51
  def setup
52
52
  create_sparkle_folder
53
+ add_to_gitignore
53
54
  copy_templates
54
55
  if config_ok?
55
56
  App.info "Sparkle", "Config found"
@@ -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 GITIGNORE OR EQUIVALENT AND BACK IT UP!
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
@@ -1,5 +1,5 @@
1
1
  module Motion::Project
2
2
  class Sparkle
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-sparkle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre L. Solleiro