class_maker_gyazz 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/README.md +39 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/class_maker_gyazz.gemspec +23 -0
- data/lib/class_maker_gyazz.rb +28 -0
- data/lib/class_maker_gyazz/version.rb +3 -0
- metadata +83 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0d8d550d1feb4b1ae944cc015ba150edca9a1bbb
|
4
|
+
data.tar.gz: 2863fa0d5886dd2cccd1584e2ed160ab6e08a701
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c0859ce0fc630ef23f723c61531c7558e86fa163a479819b240ef2e69972feb97a36324e632391c68a97fd77e7e46f4db6a9b60b0782e0f5982c4758f3011f37
|
7
|
+
data.tar.gz: 96d97dfb4f22099a78e7c45428dbe6bead17ca1c96ddd2c47d1e3574ba7c011cc19eea1dc0ca9f0a82ad6b0b132754afcc7aa8911895d90a2e2607c5cdda1447
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# ClassMakerGyazz
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/class_maker_gyazz`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'class_maker_gyazz'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install class_maker_gyazz
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
1. Fork it ( https://github.com/[my-github-username]/class_maker_gyazz/fork )
|
36
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "class_maker_gyazz"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
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 'class_maker_gyazz/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "class_maker_gyazz"
|
8
|
+
spec.version = ClassMakerGyazz::VERSION
|
9
|
+
spec.authors = ["nao215"]
|
10
|
+
spec.email = ["xxxxxy.naoxxxxx@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{HTML preprocessor by Gyazz}
|
13
|
+
spec.description = %q{This is Nao Yanagisawa's graduation thesis. SOTUGYOU SHITAI DESU. Keio University faculty of Policy Management senior Nao Yanagisawa.}
|
14
|
+
spec.homepage = ""
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.9"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require "class_maker_gyazz/version"
|
2
|
+
|
3
|
+
module ClassMakerGyazz
|
4
|
+
|
5
|
+
class Make
|
6
|
+
|
7
|
+
attr_accessor :html
|
8
|
+
|
9
|
+
def initialize text
|
10
|
+
before_depth, current_depth, next_depth = 0
|
11
|
+
rows = text.split("\n")
|
12
|
+
html = rows.map.with_index do |m, i|
|
13
|
+
puts "current #{current_depth}, next_depth #{next_depth}, before_depth #{before_depth}"
|
14
|
+
prefix = "<li>"
|
15
|
+
suffix = "</li>"
|
16
|
+
current_depth = m.length - m.lstrip.length
|
17
|
+
next_depth = rows[i + 1].length - rows[i + 1].lstrip.length unless rows.last == m
|
18
|
+
suffix = "" if next_depth > current_depth # next row will start nest
|
19
|
+
prefix = "<ul><li>" if before_depth < current_depth # nest start
|
20
|
+
suffix = "#{suffix}#{'</li></ul>' * (current_depth - next_depth)}" if current_depth > next_depth # nest end
|
21
|
+
before_depth = current_depth
|
22
|
+
"#{prefix}#{m}#{suffix}"
|
23
|
+
end
|
24
|
+
@html = "<ul>#{html.join}</ul>"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: class_maker_gyazz
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- nao215
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-17 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.9'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: This is Nao Yanagisawa's graduation thesis. SOTUGYOU SHITAI DESU. Keio
|
42
|
+
University faculty of Policy Management senior Nao Yanagisawa.
|
43
|
+
email:
|
44
|
+
- xxxxxy.naoxxxxx@gmail.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- ".gitignore"
|
50
|
+
- ".rspec"
|
51
|
+
- ".travis.yml"
|
52
|
+
- Gemfile
|
53
|
+
- README.md
|
54
|
+
- Rakefile
|
55
|
+
- bin/console
|
56
|
+
- bin/setup
|
57
|
+
- class_maker_gyazz.gemspec
|
58
|
+
- lib/class_maker_gyazz.rb
|
59
|
+
- lib/class_maker_gyazz/version.rb
|
60
|
+
homepage: ''
|
61
|
+
licenses: []
|
62
|
+
metadata: {}
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options: []
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
requirements: []
|
78
|
+
rubyforge_project:
|
79
|
+
rubygems_version: 2.4.7
|
80
|
+
signing_key:
|
81
|
+
specification_version: 4
|
82
|
+
summary: HTML preprocessor by Gyazz
|
83
|
+
test_files: []
|