mores 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5089b814082c19b5b854619abce746c88ad10ad
4
- data.tar.gz: bb17beb1e0a76a4adc8c5b0b89700ffb180eda9c
3
+ metadata.gz: 5f48b9b021f0ed8beefabb1e22879bb2a1724ad4
4
+ data.tar.gz: 46351eb0e184e6d34f1c6c8a41699993dbaaf47b
5
5
  SHA512:
6
- metadata.gz: 84d922f91adfdab3a6794d4c786bebaca7b23677de08e24dd9a6355dfff4928f304b49cb553bcd39e49cf2c8110baadec9e956bfe1f72d54364038928b43b815
7
- data.tar.gz: 97bfe43d78aab3a08c680bc78365fa644ccc94eb03fd78a4c65ce189f88579419b8cb54855f9bdd54ce6ebcc99d05145a1cb47e0e5b8059d7598dee7b1ed8942
6
+ metadata.gz: 403e5ff2f0a145cdbe80f6745877124960475ecaa7ca2af40c889e89a20acde6f078a9e8c2b88aeb7206dc636d6e10b926f5b64721c2414f11d00327c7517892
7
+ data.tar.gz: 0fd000095d08cca21cbdafad88ab32cce09f60f54e56f8518366c4e70f555bf279c087fc7c6a1fac25e5a872e9155ec8751a42df4dc785ae148827e4bf0814fd
@@ -0,0 +1,31 @@
1
+ require 'fileutils'
2
+
3
+ module Mores::Patch::FileUtils
4
+
5
+ refine ::FileUtils.singleton_class do
6
+ def compare_stream(a, b)
7
+ bsize = stream_blksize(a, b)
8
+ sa = 0.chr(Encoding::BINARY) * bsize
9
+ sb = 0.chr(Encoding::BINARY) * bsize
10
+ begin
11
+ a.read(bsize, sa)
12
+ b.read(bsize, sb)
13
+ return true if sa.empty? && sb.empty?
14
+ end while sa == sb
15
+ false
16
+ end
17
+
18
+ private
19
+
20
+ def stream_blksize(*streams)
21
+ streams.each do |s|
22
+ s.respond_to?(:stat) and
23
+ blksize = s.stat.blksize and
24
+ 0 != blksize and
25
+ return blksize
26
+ end
27
+ 0x400
28
+ end
29
+ end
30
+
31
+ end
data/lib/mores/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mores
2
- VERSION = '0.1.6'
2
+ VERSION = '0.2.0'
3
3
  end
data/lib/mores.rb CHANGED
@@ -1,7 +1,15 @@
1
1
  %w[
2
2
  version
3
- block_initialize
4
- linked_list
5
- succession
6
- immutable_struct
7
- ].each { |file| require "mores/#{file}" }
3
+ ].each { |file| require_relative "mores/#{file}" }
4
+
5
+ module Mores
6
+ module Patch end
7
+ end
8
+
9
+ [
10
+ [Mores::Patch, :FileUtils, 'patch/file_utils'],
11
+ [Mores, :BlockInitialize, 'block_initialize'],
12
+ [Mores, :LinkedList, 'linked_list' ],
13
+ [Mores, :Succession, 'succession' ],
14
+ [Mores, :ImmutableStruct, 'immutable_struct'],
15
+ ].each { |(mod, name, file)| mod.autoload name, "mores/#{file}" }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mores
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Petter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-11 00:00:00.000000000 Z
11
+ date: 2017-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -82,6 +82,7 @@ files:
82
82
  - lib/mores/immutable_struct/flyweight.rb
83
83
  - lib/mores/immutable_struct/strict.rb
84
84
  - lib/mores/linked_list.rb
85
+ - lib/mores/patch/file_utils.rb
85
86
  - lib/mores/succession.rb
86
87
  - lib/mores/version.rb
87
88
  - mores.gemspec