iostruct 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +3 -12
- data/Gemfile.lock +9 -22
- data/LICENSE.txt +2 -0
- data/README.md +29 -0
- data/Rakefile +1 -45
- data/iostruct.gemspec +23 -0
- data/lib/iostruct.rb +2 -2
- data/lib/iostruct/version.rb +3 -0
- metadata +23 -46
- data/.document +0 -5
- data/.rspec +0 -1
- data/README.rdoc +0 -19
- data/VERSION +0 -1
- data/spec/iostruct_spec.rb +0 -7
- data/spec/spec_helper.rb +0 -12
data/.gitignore
ADDED
data/Gemfile
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
source
|
2
|
-
# Add dependencies required to use your gem here.
|
3
|
-
# Example:
|
4
|
-
# gem "activesupport", ">= 2.3.5"
|
1
|
+
source 'https://rubygems.org'
|
5
2
|
|
6
|
-
#
|
7
|
-
|
8
|
-
group :development do
|
9
|
-
gem "rspec", ">= 2.8.0"
|
10
|
-
# gem "rdoc", "~> 3.12"
|
11
|
-
gem "bundler", ">= 1.0.0"
|
12
|
-
gem "jeweler", "~> 1.8.4"
|
13
|
-
end
|
3
|
+
# Specify your gem's dependencies in iostruct.gemspec
|
4
|
+
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,30 +1,17 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
iostruct (0.0.2)
|
5
|
+
|
1
6
|
GEM
|
2
|
-
remote:
|
7
|
+
remote: https://rubygems.org/
|
3
8
|
specs:
|
4
|
-
diff-lcs (1.1.3)
|
5
|
-
git (1.2.5)
|
6
|
-
jeweler (1.8.4)
|
7
|
-
bundler (~> 1.0)
|
8
|
-
git (>= 1.2.5)
|
9
|
-
rake
|
10
|
-
rdoc
|
11
|
-
json (1.7.6)
|
12
9
|
rake (10.0.3)
|
13
|
-
rdoc (3.12)
|
14
|
-
json (~> 1.4)
|
15
|
-
rspec (2.12.0)
|
16
|
-
rspec-core (~> 2.12.0)
|
17
|
-
rspec-expectations (~> 2.12.0)
|
18
|
-
rspec-mocks (~> 2.12.0)
|
19
|
-
rspec-core (2.12.2)
|
20
|
-
rspec-expectations (2.12.1)
|
21
|
-
diff-lcs (~> 1.1.3)
|
22
|
-
rspec-mocks (2.12.1)
|
23
10
|
|
24
11
|
PLATFORMS
|
25
12
|
ruby
|
26
13
|
|
27
14
|
DEPENDENCIES
|
28
|
-
bundler (
|
29
|
-
|
30
|
-
|
15
|
+
bundler (~> 1.3)
|
16
|
+
iostruct!
|
17
|
+
rake
|
data/LICENSE.txt
CHANGED
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Iostruct
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'iostruct'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install iostruct
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
CHANGED
@@ -1,45 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'bundler'
|
5
|
-
begin
|
6
|
-
Bundler.setup(:default, :development)
|
7
|
-
rescue Bundler::BundlerError => e
|
8
|
-
$stderr.puts e.message
|
9
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
-
exit e.status_code
|
11
|
-
end
|
12
|
-
require 'rake'
|
13
|
-
|
14
|
-
require 'jeweler'
|
15
|
-
Jeweler::Tasks.new do |gem|
|
16
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
-
gem.name = "iostruct"
|
18
|
-
gem.homepage = "http://github.com/zed-0xff/iostruct"
|
19
|
-
gem.license = "MIT"
|
20
|
-
gem.summary = %Q{A Struct that can read/write itself from/to IO-like objects}
|
21
|
-
# gem.description = %Q{TODO: longer description of your gem}
|
22
|
-
gem.email = "zed.0xff@gmail.com"
|
23
|
-
gem.authors = ["Andrey \"Zed\" Zaikin"]
|
24
|
-
gem.files.include 'lib/**/*.rb'
|
25
|
-
# dependencies defined in Gemfile
|
26
|
-
end
|
27
|
-
Jeweler::RubygemsDotOrgTasks.new
|
28
|
-
|
29
|
-
require 'rspec/core'
|
30
|
-
require 'rspec/core/rake_task'
|
31
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
32
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
33
|
-
end
|
34
|
-
|
35
|
-
task :default => :spec
|
36
|
-
|
37
|
-
require 'rdoc/task'
|
38
|
-
Rake::RDocTask.new do |rdoc|
|
39
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
40
|
-
|
41
|
-
rdoc.rdoc_dir = 'rdoc'
|
42
|
-
rdoc.title = "iostruct #{version}"
|
43
|
-
rdoc.rdoc_files.include('README*')
|
44
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
45
|
-
end
|
1
|
+
require "bundler/gem_tasks"
|
data/iostruct.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'iostruct/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "iostruct"
|
8
|
+
s.version = IOStruct::VERSION
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Andrey \"Zed\" Zaikin"]
|
12
|
+
s.date = "2013-01-08"
|
13
|
+
s.email = "zed.0xff@gmail.com"
|
14
|
+
s.files = `git ls-files`.split($/)
|
15
|
+
s.homepage = "http://github.com/zed-0xff/iostruct"
|
16
|
+
s.licenses = ["MIT"]
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.summary = "A Struct that can read/write itself from/to IO-like objects"
|
19
|
+
|
20
|
+
s.add_development_dependency "bundler", "~> 1.3"
|
21
|
+
s.add_development_dependency "rake"
|
22
|
+
end
|
23
|
+
|
data/lib/iostruct.rb
CHANGED
@@ -3,9 +3,9 @@ module IOStruct
|
|
3
3
|
size = fmt.scan(/([a-z])(\d*)/i).map do |f,len|
|
4
4
|
[len.to_i, 1].max *
|
5
5
|
case f
|
6
|
-
when /[
|
6
|
+
when /[AC]/i then 1
|
7
7
|
when 'v' then 2
|
8
|
-
when 'V','l' then 4
|
8
|
+
when 'V','l','L' then 4
|
9
9
|
when 'Q' then 8
|
10
10
|
else raise "unknown fmt #{f.inspect}"
|
11
11
|
end
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iostruct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
4
5
|
prerelease:
|
5
|
-
version: 0.0.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Andrey "Zed" Zaikin
|
@@ -12,72 +12,52 @@ cert_chain: []
|
|
12
12
|
date: 2013-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
|
16
|
-
type: :development
|
17
|
-
name: rspec
|
15
|
+
name: bundler
|
18
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
19
18
|
requirements:
|
20
|
-
- -
|
19
|
+
- - ~>
|
21
20
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
23
|
-
|
21
|
+
version: '1.3'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
25
26
|
requirements:
|
26
|
-
- -
|
27
|
+
- - ~>
|
27
28
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
29
|
-
none: false
|
29
|
+
version: '1.3'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
|
32
|
-
type: :development
|
33
|
-
name: bundler
|
31
|
+
name: rake
|
34
32
|
requirement: !ruby/object:Gem::Requirement
|
35
|
-
requirements:
|
36
|
-
- - ! '>='
|
37
|
-
- !ruby/object:Gem::Version
|
38
|
-
version: 1.0.0
|
39
33
|
none: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
34
|
requirements:
|
42
35
|
- - ! '>='
|
43
36
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
45
|
-
none: false
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
prerelease: false
|
37
|
+
version: '0'
|
48
38
|
type: :development
|
49
|
-
|
50
|
-
requirement: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 1.8.4
|
55
|
-
none: false
|
39
|
+
prerelease: false
|
56
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
57
42
|
requirements:
|
58
|
-
- -
|
43
|
+
- - ! '>='
|
59
44
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
61
|
-
none: false
|
45
|
+
version: '0'
|
62
46
|
description:
|
63
47
|
email: zed.0xff@gmail.com
|
64
48
|
executables: []
|
65
49
|
extensions: []
|
66
|
-
extra_rdoc_files:
|
67
|
-
- LICENSE.txt
|
68
|
-
- README.rdoc
|
50
|
+
extra_rdoc_files: []
|
69
51
|
files:
|
70
|
-
- .
|
71
|
-
- .rspec
|
52
|
+
- .gitignore
|
72
53
|
- Gemfile
|
73
54
|
- Gemfile.lock
|
74
55
|
- LICENSE.txt
|
75
|
-
- README.
|
56
|
+
- README.md
|
76
57
|
- Rakefile
|
77
|
-
-
|
58
|
+
- iostruct.gemspec
|
78
59
|
- lib/iostruct.rb
|
79
|
-
-
|
80
|
-
- spec/spec_helper.rb
|
60
|
+
- lib/iostruct/version.rb
|
81
61
|
homepage: http://github.com/zed-0xff/iostruct
|
82
62
|
licenses:
|
83
63
|
- MIT
|
@@ -86,20 +66,17 @@ rdoc_options: []
|
|
86
66
|
require_paths:
|
87
67
|
- lib
|
88
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
89
70
|
requirements:
|
90
71
|
- - ! '>='
|
91
72
|
- !ruby/object:Gem::Version
|
92
73
|
version: '0'
|
93
|
-
segments:
|
94
|
-
- 0
|
95
|
-
hash: -1210873217428652448
|
96
|
-
none: false
|
97
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
98
76
|
requirements:
|
99
77
|
- - ! '>='
|
100
78
|
- !ruby/object:Gem::Version
|
101
79
|
version: '0'
|
102
|
-
none: false
|
103
80
|
requirements: []
|
104
81
|
rubyforge_project:
|
105
82
|
rubygems_version: 1.8.24
|
data/.document
DELETED
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color
|
data/README.rdoc
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
= iostruct
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Contributing to iostruct
|
6
|
-
|
7
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
-
* Fork the project.
|
10
|
-
* Start a feature/bugfix branch.
|
11
|
-
* Commit and push until you are happy with your contribution.
|
12
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2013 Andrey "Zed" Zaikin. See LICENSE.txt for
|
18
|
-
further details.
|
19
|
-
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.0.1
|
data/spec/iostruct_spec.rb
DELETED
data/spec/spec_helper.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
-
require 'rspec'
|
4
|
-
require 'iostruct'
|
5
|
-
|
6
|
-
# Requires supporting files with custom matchers and macros, etc,
|
7
|
-
# in ./support/ and its subdirectories.
|
8
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
-
|
10
|
-
RSpec.configure do |config|
|
11
|
-
|
12
|
-
end
|