_ 1.3 → 1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +26 -0
- data/Rakefile +1 -0
- data/_.gemspec +20 -0
- data/lib/_.rb +23 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b97ae4b793c3543d82bca92baf0f131af8cf8360b7a6dd5ab5c6b575c89dffd
|
4
|
+
data.tar.gz: 3dd31b9709f88c50329bf3681fb778d179971b6414dae7e4209d75dacaea8e7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1134295f5c8c9629b281adb89751f6d2581650182a7e0da003db177e8367580bd31b7da6375a0858ac59bcf117638162fb2c22bbf3f1d330d1e028ed2cbb3626
|
7
|
+
data.tar.gz: bd21b0aecbc726d6af631b32d9f5629e95dc1a386b236cd5c92b97e6973e5cda8587fe1fd043409e473730b9bec164ef827257eb450a46600a4a36447a0aec12
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pkg/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2009 Yusuke Endoh
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# `_`
|
2
|
+
|
3
|
+
`_` allows you to write Ruby script by using only `_`.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
$ gem install _
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
The following __script__ is a "Hello, world!" program which can be executed by Ruby interpreter:
|
12
|
+
|
13
|
+
require "_"
|
14
|
+
____ _ _____ ____ __ ____ ____ __ ___ ____ __ __ _ ______
|
15
|
+
_____ ___ _ _ ___ _____ ______ ____ _ _ ____ _ _ ____ _
|
16
|
+
____ __ __ ___ _ ______ ___ ____ __ ______ ____ _ ____ ____
|
17
|
+
__ _ ____ _ _ ___ _____ _____ _ ______ ____ _ ______ _____
|
18
|
+
|
19
|
+
You can make a `__script__` by `__script__`:
|
20
|
+
|
21
|
+
require "_"
|
22
|
+
puts __script__('puts"Hello, world!"')
|
23
|
+
|
24
|
+
## License
|
25
|
+
|
26
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/_.gemspec
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
|
4
|
+
Gem::Specification.new do |spec|
|
5
|
+
spec.name = "_"
|
6
|
+
spec.version = "1.4"
|
7
|
+
spec.authors = ["Yusuke Endoh"]
|
8
|
+
spec.email = ["mame@ruby-lang.org"]
|
9
|
+
|
10
|
+
spec.summary = %q{_ allows you to write Ruby script by using only _.}
|
11
|
+
spec.description = %q{_ allows you to write Ruby script by using only _.}
|
12
|
+
spec.homepage = "http://github.com/mame/_"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.require_paths = ["lib"]
|
17
|
+
|
18
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
19
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
20
|
+
end
|
data/lib/_.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
def __script__(src)
|
2
|
+
code = []
|
3
|
+
src = src.unpack("C*").map {|c| c.ord.to_s(6).rjust(3, "0").chars.to_a }
|
4
|
+
src.flatten(1).map {|n| n.to_i(6) + 1 }.each do |n|
|
5
|
+
code.empty? || code.last.size + n + 1 >= 60 ? code << "" : code.last << " "
|
6
|
+
code.last << "_" * n
|
7
|
+
end
|
8
|
+
([%q(require "_")] + code).join("\n")
|
9
|
+
end
|
10
|
+
|
11
|
+
$code, $fragment = [], []
|
12
|
+
def method_missing(mhd, *x)
|
13
|
+
if x.empty?
|
14
|
+
$code.concat($fragment.reverse)
|
15
|
+
$fragment.clear
|
16
|
+
end
|
17
|
+
$fragment << (mhd.to_s.size - 1).to_s
|
18
|
+
end
|
19
|
+
|
20
|
+
at_exit do
|
21
|
+
$code.concat($fragment.reverse)
|
22
|
+
eval($code.join.scan(/.../).map {|c| c.to_i(6) }.pack("C*"))
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: _
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yusuke Endoh
|
@@ -44,7 +44,14 @@ email:
|
|
44
44
|
executables: []
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
|
-
files:
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- _.gemspec
|
54
|
+
- lib/_.rb
|
48
55
|
homepage: http://github.com/mame/_
|
49
56
|
licenses:
|
50
57
|
- MIT
|