limits 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 78e669e31abc8a928a07746b308b877acb950a07
4
+ data.tar.gz: 05c89485e629aaaad5d8ec96a7071f289469c520
5
+ SHA512:
6
+ metadata.gz: 991ab101fd38af87df374ac5c78c6cb6509e79f376ce56194b0abc703ac18bd3a172a1fbd7fae40b3b7c541038a0e7606971527b3578e110532d8c0e512066c6
7
+ data.tar.gz: fa55a354856e024729d854853c66cbe42da0a03c6916e1a9dc5eed137437dd5ada1ba739b8b9520f930836a9d3841595b3cfe100d1b13646d67bf14bca860596
@@ -0,0 +1,20 @@
1
+ *.gem
2
+ *.rbc
3
+ *.bundle
4
+ *.so
5
+ *.o
6
+ .bundle
7
+ .config
8
+ .yardoc
9
+ Gemfile.lock
10
+ InstalledFiles
11
+ _yardoc
12
+ coverage
13
+ doc/
14
+ lib/bundler/man
15
+ pkg
16
+ rdoc
17
+ spec/reports
18
+ test/tmp
19
+ test/version_tmp
20
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 ksss
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,45 @@
1
+ # Limits
2
+
3
+ Const Collections of limits.h in Ruby.
4
+
5
+ ## Consts
6
+
7
+ All const value is same in **limits.h** installed in your machine.
8
+
9
+ ```ruby
10
+ Limits::CHAR_BIT
11
+ Limits::MB_LEN_MAX
12
+ Limits::CHAR_MAX
13
+ Limits::CHAR_MIN
14
+ Limits::UCHAR_MAX
15
+ Limits::SHRT_MAX
16
+ Limits::SHRT_MIN
17
+ Limits::USHRT_MAX
18
+ Limits::INT_MAX
19
+ Limits::INT_MIN
20
+ Limits::UINT_MAX
21
+ Limits::LONG_MAX
22
+ Limits::LONG_MIN
23
+ Limits::ULONG_MAX
24
+ Limits::LLONG_MAX
25
+ Limits::LLONG_MIN
26
+ Limits::ULLONG_MAX
27
+ ```
28
+
29
+ ## Installation
30
+
31
+ Add this line to your application's Gemfile:
32
+
33
+ gem 'limits'
34
+
35
+ And then execute:
36
+
37
+ $ bundle
38
+
39
+ Or install it yourself as:
40
+
41
+ $ gem install limits
42
+
43
+ ## License
44
+
45
+ MIT
@@ -0,0 +1,21 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require 'rspec/core'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec) do |t|
7
+ t.rspec_opts = ["-c", "-f progress", "-Ilib"]
8
+ t.pattern = "spec/**/*_spec.rb"
9
+ t.verbose = true
10
+ end
11
+ task :spec => :compile
12
+
13
+ require 'rake/extensiontask'
14
+ spec = Bundler::GemHelper.gemspec
15
+ Rake::ExtensionTask.new('limits', spec) do |ext|
16
+ ext.ext_dir = 'ext/limits'
17
+ ext.lib_dir = 'lib/limits'
18
+ end
19
+
20
+
21
+ task :default => [:spec]
@@ -0,0 +1,5 @@
1
+ require 'mkmf'
2
+
3
+ $CFLAGS << " -Wall"
4
+
5
+ create_makefile('limits/limits')
@@ -0,0 +1,31 @@
1
+ #include "ruby.h"
2
+
3
+ void
4
+ Init_limits(void)
5
+ {
6
+ VALUE mLimits;
7
+ mLimits = rb_define_module("Limits");
8
+
9
+ rb_define_const(mLimits, "CHAR_BIT", INT2FIX(CHAR_BIT));
10
+ rb_define_const(mLimits, "MB_LEN_MAX", INT2FIX(MB_LEN_MAX));
11
+
12
+ rb_define_const(mLimits, "CHAR_MAX", INT2FIX(CHAR_MAX));
13
+ rb_define_const(mLimits, "CHAR_MIN", INT2FIX(CHAR_MIN));
14
+ rb_define_const(mLimits, "UCHAR_MAX", INT2FIX(UCHAR_MAX));
15
+
16
+ rb_define_const(mLimits, "SHRT_MAX", INT2FIX(SHRT_MAX));
17
+ rb_define_const(mLimits, "SHRT_MIN", INT2FIX(SHRT_MIN));
18
+ rb_define_const(mLimits, "USHRT_MAX", INT2FIX(USHRT_MAX));
19
+
20
+ rb_define_const(mLimits, "INT_MAX", INT2FIX(INT_MAX));
21
+ rb_define_const(mLimits, "INT_MIN", INT2FIX(INT_MIN));
22
+ rb_define_const(mLimits, "UINT_MAX", INT2FIX(UINT_MAX));
23
+
24
+ rb_define_const(mLimits, "LONG_MAX", LL2NUM(LONG_MAX));
25
+ rb_define_const(mLimits, "LONG_MIN", LL2NUM(LONG_MIN));
26
+ rb_define_const(mLimits, "ULONG_MAX", ULL2NUM(ULONG_MAX));
27
+
28
+ rb_define_const(mLimits, "LLONG_MAX", LL2NUM(LLONG_MAX));
29
+ rb_define_const(mLimits, "LLONG_MIN", LL2NUM(LLONG_MIN));
30
+ rb_define_const(mLimits, "ULLONG_MAX", ULL2NUM(ULLONG_MAX));
31
+ }
@@ -0,0 +1,6 @@
1
+ begin
2
+ require "limits/#{RUBY_VERSION[/\d+.\d+/]}/limits"
3
+ rescue LoadError
4
+ require "limits/limits"
5
+ end
6
+ require "limits/version"
@@ -0,0 +1,3 @@
1
+ module Limits
2
+ VERSION = "1.0.0"
3
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'limits/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "limits"
8
+ spec.version = Limits::VERSION
9
+ spec.author = "ksss"
10
+ spec.email = "co000ri@gmail.com"
11
+ spec.description = %q{Const Collections of limits.h.}
12
+ spec.summary = %q{Const Collections of limits.h.}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+ spec.extensions = ["ext/limits/extconf.rb"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.3"
23
+ spec.add_development_dependency "rake"
24
+ spec.add_development_dependency "rspec", ['~> 2.11']
25
+ spec.add_development_dependency "rake-compiler", ["~> 0.8.3"]
26
+ end
@@ -0,0 +1,23 @@
1
+ require 'limits'
2
+
3
+ describe Limits do
4
+ it "const" do
5
+ expect(Limits::CHAR_BIT).to be_a_kind_of(Integer)
6
+ expect(Limits::MB_LEN_MAX).to be_a_kind_of(Integer)
7
+ expect(Limits::CHAR_MAX).to be_a_kind_of(Integer)
8
+ expect(Limits::CHAR_MIN).to be_a_kind_of(Integer)
9
+ expect(Limits::UCHAR_MAX).to be_a_kind_of(Integer)
10
+ expect(Limits::SHRT_MAX).to be_a_kind_of(Integer)
11
+ expect(Limits::SHRT_MIN).to be_a_kind_of(Integer)
12
+ expect(Limits::USHRT_MAX).to be_a_kind_of(Integer)
13
+ expect(Limits::INT_MAX).to be_a_kind_of(Integer)
14
+ expect(Limits::INT_MIN).to be_a_kind_of(Integer)
15
+ expect(Limits::UINT_MAX).to be_a_kind_of(Integer)
16
+ expect(Limits::LONG_MAX).to be_a_kind_of(Integer)
17
+ expect(Limits::LONG_MIN).to be_a_kind_of(Integer)
18
+ expect(Limits::ULONG_MAX).to be_a_kind_of(Integer)
19
+ expect(Limits::LLONG_MAX).to be_a_kind_of(Integer)
20
+ expect(Limits::LLONG_MIN).to be_a_kind_of(Integer)
21
+ expect(Limits::ULLONG_MAX).to be_a_kind_of(Integer)
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: limits
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - ksss
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.11'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.11'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake-compiler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.8.3
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.8.3
69
+ description: Const Collections of limits.h.
70
+ email: co000ri@gmail.com
71
+ executables: []
72
+ extensions:
73
+ - ext/limits/extconf.rb
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - LICENSE.txt
79
+ - README.md
80
+ - Rakefile
81
+ - ext/limits/extconf.rb
82
+ - ext/limits/limits.c
83
+ - lib/limits.rb
84
+ - lib/limits/version.rb
85
+ - limits.gemspec
86
+ - spec/limits_spec.rb
87
+ homepage: ''
88
+ licenses:
89
+ - MIT
90
+ metadata: {}
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubyforge_project:
107
+ rubygems_version: 2.2.0
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: Const Collections of limits.h.
111
+ test_files:
112
+ - spec/limits_spec.rb
113
+ has_rdoc: