chek 1.0.0

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.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in chek.gemspec
4
+ gemspec
5
+
6
+ # development dependencies for gem
7
+ group :development do
8
+ gem "rspec", "~> 2.10.0"
9
+ end
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 toooooooby
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.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # Chek
2
+
3
+ You can gesture **require** or **not require** in ruby script.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'chek'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install chek
18
+
19
+ ## Usage
20
+
21
+ require 'chek'
22
+
23
+ ☑ 'pathname' # I wanna use pathname :)
24
+ ☐ 'fileutils' # I don't wanna use fileutils now :p
25
+
26
+ This means like below codes.
27
+
28
+ require 'pathname' # I wanna use pathname :)
29
+ require 'fileutils' # I don't wanna use fileutils now :p
30
+
31
+ ## Contributing
32
+
33
+ 1. Fork it
34
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
35
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
36
+ 4. Push to the branch (`git push origin my-new-feature`)
37
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+
4
+ require 'rspec/core'
5
+ require 'rspec/core/rake_task'
6
+ RSpec::Core::RakeTask.new(:spec) do |spec|
7
+ spec.pattern = FileList['spec/**/*_spec.rb']
8
+ end
9
+
10
+ task :default => :spec
data/chek.gemspec ADDED
@@ -0,0 +1,18 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/chek/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["toooooooby"]
6
+ gem.email = ["toby.net.info.mail+git@gmail.com"]
7
+ gem.description = %q{You can gesture require or not in ruby script. ☑ or ☐.}
8
+ gem.summary = %q{You can gesture require or not in ruby script.}
9
+
10
+ gem.files = `git ls-files`.split($\)
11
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
12
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
+ gem.name = "chek"
14
+ gem.require_paths = ["lib"]
15
+ gem.version = Chek::VERSION
16
+
17
+ gem.homepage = "https://github.com/#{gem.authors.first}/#{gem.name}/"
18
+ end
@@ -0,0 +1,3 @@
1
+ module Chek
2
+ VERSION = "1.0.0"
3
+ end
data/lib/chek.rb ADDED
@@ -0,0 +1,11 @@
1
+ # -*- coding: utf-8 -*-
2
+ require "chek/version"
3
+
4
+ module Kernel
5
+ def ☑ path
6
+ require path
7
+ end
8
+
9
+ def ☐ path
10
+ end
11
+ end
data/spec/chek_spec.rb ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
4
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__)))
5
+
6
+ describe Chek do
7
+ it "normal require" do
8
+ expect { require 'foobar-can-not-require' }.to raise_error(LoadError)
9
+ expect { require 'foobar-normal' }.to_not raise_error(LoadError)
10
+ FoobarNormal.piyo.should == "piyopiyo"
11
+ end
12
+
13
+ context '☑' do
14
+ it "require" do
15
+ expect { ☑ 'foobar-can-not-require' }.to raise_error(LoadError)
16
+ expect { ☑ 'foobar-with-chek' }.to_not raise_error(LoadError)
17
+ FoobarWithChek.piyo.should == "piyopiyo"
18
+ end
19
+ end
20
+
21
+ context '☐' do
22
+ it "does not require" do
23
+ expect { ☐ 'foobar-can-not-require' }.to_not raise_error(LoadError)
24
+ expect { ☐ 'foobar-without-chek' }.to_not raise_error(LoadError)
25
+ expect { FoobarWithoutChek.piyo }.to raise_error(NameError)
26
+ end
27
+ end
28
+ end
29
+
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+ module FoobarNormal
4
+ def self.piyo
5
+ "piyopiyo"
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+ module FoobarWithChek
4
+ def self.piyo
5
+ "piyopiyo"
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+ module FoobarWithoutChek
4
+ def self.piyo
5
+ "piyopiyo"
6
+ end
7
+ end
@@ -0,0 +1,19 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # Require this file using `require "spec_helper.rb"` to ensure that it is only
4
+ # loaded once.
5
+ #
6
+ require 'rubygems'
7
+ require 'bundler/setup'
8
+
9
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
10
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
11
+ require 'rspec'
12
+ require 'chek'
13
+
14
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
15
+ RSpec.configure do |config|
16
+ config.treat_symbols_as_metadata_keys_with_true_values = true
17
+ config.run_all_when_everything_filtered = true
18
+ config.filter_run :focus
19
+ end
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: chek
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - toooooooby
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-20 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: You can gesture require or not in ruby script. ☑ or ☐.
15
+ email:
16
+ - toby.net.info.mail+git@gmail.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - .gitignore
22
+ - Gemfile
23
+ - LICENSE
24
+ - README.md
25
+ - Rakefile
26
+ - chek.gemspec
27
+ - lib/chek.rb
28
+ - lib/chek/version.rb
29
+ - spec/chek_spec.rb
30
+ - spec/foobar-normal.rb
31
+ - spec/foobar-with-chek.rb
32
+ - spec/foobar-without-chek.rb
33
+ - spec/spec_helper.rb
34
+ homepage: https://github.com/toooooooby/chek/
35
+ licenses: []
36
+ post_install_message:
37
+ rdoc_options: []
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubyforge_project:
54
+ rubygems_version: 1.8.23
55
+ signing_key:
56
+ specification_version: 3
57
+ summary: You can gesture require or not in ruby script.
58
+ test_files:
59
+ - spec/chek_spec.rb
60
+ - spec/foobar-normal.rb
61
+ - spec/foobar-with-chek.rb
62
+ - spec/foobar-without-chek.rb
63
+ - spec/spec_helper.rb
64
+ has_rdoc: