rscons 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
- MTMyNzAyZWY0MzY3YWExYWUzNmFhZjBmNjVkMGUzNmRiZGUxZjZkNQ==
4
+ ZTUxZTAyODAxMDQ0ZjJlODQxYThmN2M2Y2ZiOWMxNzAyNjBlZDJiNw==
5
5
  data.tar.gz: !binary |-
6
- MTc4NDU4ODYwYjA4ZjQ4ZDhlNjgzZWEzYTdjZTg2Y2QyZTZhMzQzNA==
6
+ NDIzM2M0YzQ1ODczZWI1YWI1YmM3MTI3ZDVlMTQ0NGUwYmUyN2YwNg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Mjc2M2EzY2E3ZDE3NWVhMDlhM2RlYWNlMWRlYWQzODVmYmI5NjdjM2Q0ZGY5
10
- ZGQzNjg4MjJkY2Y5ZTJkNzRjMzBiZGQyNDQ1YTFiZjE0OTQ4ZjM5ZjYwODFk
11
- NzBkZGViZDQ4YzhhZmUzZmViMGIzNjQ4Y2Q3M2ZiNjA0Y2ViNzA=
9
+ MzRlZDkxZDNhNWYwOWU3OTgwYjIwYmZlOGY2YmRlOTAxNmVmMzVhMDMyYTY0
10
+ M2ZiZjhlMDRkOTQ0MTljOTgyNGMzNDE5NDQ0ODk3ZTYwOTUxMThlZmE5YzE0
11
+ MWU3Y2ZjODkyOGRjYWYzM2ZlZDU4ODJlNzRkNTdjZDQ4Nzc1NDU=
12
12
  data.tar.gz: !binary |-
13
- NDdmMjE3NDQ2ZWI4YmQ1MzdkNWNjZjJiNWQxZjJlMDU1MDcwZDQ2OGQyOWMx
14
- NzM4MDlmMzEwYmVkOGJjZWFhNzVhY2Q0MGM2YTAwYmZjNmI2Mzg3ZWFiOGI4
15
- ZTc2MDk3ZTgyZTgxMTliYTJhMTU1MDU3YWIzMDBmMTgwNTZiNjI=
13
+ NThmYjIxNDYwNjkxZmU1NjBkYjMxYzE3MWIzMDdhNzU2YWMzMzg3ZTM5ZjY1
14
+ NjBhNjAxNmZkYjg1MzA1NWIxOTA5MmQ3MTRkOGM1ODVlN2VhN2EyYzZhMWNj
15
+ M2M4ODU4YzJhNzBlNmMwNTM4NDlhNzI0ZjNmYzk4OTY3ZTA3ZDM=
data/lib/rscons/cache.rb CHANGED
@@ -80,6 +80,7 @@ module Rscons
80
80
  # @return true value if the target is up to date, meaning that:
81
81
  # - the target exists on disk
82
82
  # - the cache has information for the target
83
+ # - the target's checksum matches its checksum when it was last built
83
84
  # - the command used to build the target is the same as last time
84
85
  # - all dependencies listed are also listed in the cache, or, if
85
86
  # :strict_deps was given in options, the list of dependencies is
@@ -93,6 +94,9 @@ module Rscons
93
94
  # target must be registered in the cache
94
95
  return false unless @cache[:targets].has_key?(target)
95
96
 
97
+ # target must have the same checksum as when it was built last
98
+ return false unless @cache[:targets][target][:checksum] == lookup_checksum(target)
99
+
96
100
  # command used to build target must be identical
97
101
  return false unless @cache[:targets][target][:command] == command
98
102
 
@@ -141,7 +145,7 @@ module Rscons
141
145
  # Calculate and return a file's checksum
142
146
  # @param file [String] The file name.
143
147
  def calculate_checksum(file)
144
- @lookup_checksums[file] = Digest::MD5.hexdigest(File.read(file)).encode(__ENCODING__) rescue ''
148
+ @lookup_checksums[file] = Digest::MD5.hexdigest(File.read(file, {mode: 'rb'})).encode(__ENCODING__) rescue ''
145
149
  end
146
150
  end
147
151
  end
@@ -1,4 +1,4 @@
1
1
  module Rscons
2
2
  # gem version
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rscons
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
  - Josh Holtrop