org_tp 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b19f301e1053e1ef6c9afea9b632d6acc0f9038a
4
- data.tar.gz: 2c5514af8fc21edee5ee3249b29b7fd0fbaca468
3
+ metadata.gz: 7c10df83682adb368630c8fbc032f49c1fe70f1f
4
+ data.tar.gz: 70c52d776a82dbe28ee1ca82015dcf9571501e5c
5
5
  SHA512:
6
- metadata.gz: 6a8fafd5dd6219554af1cf21f1cad6059d2a6b4c23605d92fb4f5b280d52406eff7dea59eba937fcf1a667353c498e01ff9378b9efa4e49ccfefa84f88823497
7
- data.tar.gz: 7dcc3ed9dbba03727cb9ccbafffde29c909d299c563bacea88819d821e2ac9f04512fb781f7fc954881510363e6c2859fea71629683ab1459479ca004293328e
6
+ metadata.gz: 5949b282e969e2f718135f8e59ef676a72804c7536a416db10607d62e687e8f4910a8f9f91626faa5cc39d240c8a53820ed2c89ee51ddc8964b796edd9b986e2
7
+ data.tar.gz: 74f188d04ce1f4bc7058242b8de9cc93887c396e1a91f2165349afb2b643ebf56b56c830bde19404f6657aaae59c2c24d736182e2959803c5aa604709d80b56c
data/README.org CHANGED
@@ -1,11 +1,20 @@
1
1
  * OrgTp
2
2
 
3
- OrgTp shows ascii table like emacs org-table for easy reading.
3
+ OrgTp shows text table like emacs org-table for easy reading.
4
4
 
5
- ** Install
5
+ ** Installation
6
+
7
+ Install as a standalone gem
6
8
 
7
9
  #+BEGIN_SRC shell
8
- gem install org_tp
10
+ $ gem install org_tp
11
+ #+END_SRC
12
+
13
+ Or install within application using Gemfile
14
+
15
+ #+BEGIN_SRC shell
16
+ $ bundle add org_tp
17
+ $ bundle install
9
18
  #+END_SRC
10
19
 
11
20
  ** Examples
@@ -13,7 +22,7 @@ gem install org_tp
13
22
  *** Array of hash
14
23
 
15
24
  #+BEGIN_SRC ruby
16
- tp [{id: 1, name: "alice"}, {id: 2, name: "bob"}]
25
+ tp [{id: 1, name: 'alice'}, {id: 2, name: 'bob'}]
17
26
  # >> |----+-------|
18
27
  # >> | id | name |
19
28
  # >> |----+-------|
@@ -25,7 +34,7 @@ tp [{id: 1, name: "alice"}, {id: 2, name: "bob"}]
25
34
  *** Hash
26
35
 
27
36
  #+BEGIN_SRC ruby
28
- tp({id: 1, name: "alice"})
37
+ tp({id: 1, name: 'alice'})
29
38
  # >> |------+-------|
30
39
  # >> | id | 1 |
31
40
  # >> | name | alice |
@@ -35,10 +44,10 @@ tp({id: 1, name: "alice"})
35
44
  *** Array
36
45
 
37
46
  #+BEGIN_SRC ruby
38
- tp [:alice, :bobo]
47
+ tp [:alice, :bob]
39
48
  # >> |-------|
40
49
  # >> | alice |
41
- # >> | bobo |
50
+ # >> | bob |
42
51
  # >> |-------|
43
52
  #+END_SRC
44
53
 
@@ -52,7 +61,7 @@ tp 1
52
61
  #+END_SRC
53
62
 
54
63
  #+BEGIN_SRC ruby
55
- tp "foo"
64
+ tp 'foo'
56
65
  # >> |-----|
57
66
  # >> | foo |
58
67
  # >> |-----|
@@ -65,10 +74,10 @@ tp :foo
65
74
  # >> |-----|
66
75
  #+END_SRC
67
76
 
68
- *** ActiveRecord and Mongoid
77
+ *** ActiveRecord or Mongoid
69
78
 
70
79
  #+BEGIN_SRC ruby
71
- ["alice", "bob"].each {|e| User.create!(name: e) }
80
+ ['alice', 'bob'].each {|e| User.create!(name: e) }
72
81
  #+END_SRC
73
82
 
74
83
  #+BEGIN_SRC ruby
@@ -101,7 +110,7 @@ tp User.first
101
110
  **** ActiveRecord::Result
102
111
 
103
112
  #+BEGIN_SRC ruby
104
- tp ActiveRecord::Base.connection.select_all("SELECT * FROM users")
113
+ tp ActiveRecord::Base.connection.select_all('SELECT * FROM users')
105
114
  # >> |----+-------|
106
115
  # >> | id | name |
107
116
  # >> |----+-------|
@@ -113,7 +122,7 @@ tp ActiveRecord::Base.connection.select_all("SELECT * FROM users")
113
122
  ** How to table as string
114
123
 
115
124
  #+BEGIN_SRC ruby
116
- puts [{id: 1, name: "alice"}, {id: 2, name: "bob"}].to_t
125
+ puts [{id: 1, name: 'alice'}, {id: 2, name: 'bob'}].to_t
117
126
  # >> |----+-------|
118
127
  # >> | id | name |
119
128
  # >> |----+-------|
@@ -130,7 +139,7 @@ tp 1
130
139
  # >> | 1 |
131
140
  # >> |---|
132
141
 
133
- tp 1, intersection_both: "+"
142
+ tp 1, intersection_both: '+'
134
143
  # >> +---+
135
144
  # >> | 1 |
136
145
  # >> +---+
@@ -155,10 +164,22 @@ tp 1
155
164
  # >> | 1 |
156
165
  # >> |---|
157
166
 
158
- OrgTp::Generator.default_options[:intersection_both] = "+"
167
+ OrgTp::Generator.default_options[:intersection_both] = '+'
159
168
 
160
169
  tp 1
161
170
  # >> +---+
162
171
  # >> | 1 |
163
172
  # >> +---+
164
173
  #+END_SRC
174
+
175
+ ** When used in conjunction with Tapp
176
+
177
+ #+BEGIN_SRC ruby
178
+ require 'tapp'
179
+ require 'org_tp'
180
+
181
+ 1.tapp(:tp) + 2
182
+ # >> |---|
183
+ # >> | 1 |
184
+ # >> |---|
185
+ #+END_SRC
@@ -1,15 +1,15 @@
1
- $LOAD_PATH << "../lib"
2
- require "org_tp"
1
+ $LOAD_PATH << '../lib'
2
+ require 'org_tp'
3
3
 
4
4
  tp 1
5
- tp "foo"
5
+ tp 'foo'
6
6
  tp :foo
7
- tp [:alice, :bobo]
8
- tp({id: 1, name: "alice"})
9
- tp [{id: 1, name: "alice"}, {id: 2, name: "bob"}]
10
- puts [{id: 1, name: "alice"}, {id: 2, name: "bob"}].to_t
11
- puts [{"a" => ["a"]}].to_t
12
- puts [{"a" => {"a" => 1}}].to_t
7
+ tp [:alice, :bob]
8
+ tp({id: 1, name: 'alice'})
9
+ tp [{id: 1, name: 'alice'}, {id: 2, name: 'bob'}]
10
+ puts [{id: 1, name: 'alice'}, {id: 2, name: 'bob'}].to_t
11
+ puts [{'a' => ['a']}].to_t
12
+ puts [{'a' => {'a' => 1}}].to_t
13
13
  # >> |---|
14
14
  # >> | 1 |
15
15
  # >> |---|
@@ -21,7 +21,7 @@ puts [{"a" => {"a" => 1}}].to_t
21
21
  # >> |-----|
22
22
  # >> |-------|
23
23
  # >> | alice |
24
- # >> | bobo |
24
+ # >> | bob |
25
25
  # >> |-------|
26
26
  # >> |------+-------|
27
27
  # >> | id | 1 |
@@ -42,10 +42,10 @@ puts [{"a" => {"a" => 1}}].to_t
42
42
  # >> |-------|
43
43
  # >> | a |
44
44
  # >> |-------|
45
- # >> | ["a"] |
45
+ # >> | ['a'] |
46
46
  # >> |-------|
47
47
  # >> |----------|
48
48
  # >> | a |
49
49
  # >> |----------|
50
- # >> | {"a"=>1} |
50
+ # >> | {'a'=>1} |
51
51
  # >> |----------|
@@ -1,10 +1,10 @@
1
- $LOAD_PATH << "../lib"
2
- require "active_record"
3
- require "org_tp"
1
+ $LOAD_PATH << '../lib'
2
+ require 'active_record'
3
+ require 'org_tp'
4
4
 
5
5
  ActiveRecord::Base.include(OrgTp::ActiveRecord)
6
6
 
7
- ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
7
+ ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
8
8
  ActiveRecord::Migration.verbose = false
9
9
  ActiveRecord::Schema.define do
10
10
  create_table :users do |t|
@@ -15,12 +15,12 @@ end
15
15
  class User < ActiveRecord::Base
16
16
  end
17
17
 
18
- ["alice", "bob", "carol"].each { |e| User.create!(name: e) }
18
+ ['alice', 'bob', 'carol'].each { |e| User.create!(name: e) }
19
19
 
20
20
  tp User
21
21
  tp User.first
22
22
  tp User.limit(1)
23
- tp ActiveRecord::Base.connection.select_all("SELECT * FROM users")
23
+ tp ActiveRecord::Base.connection.select_all('SELECT * FROM users')
24
24
  # >> |----+-------|
25
25
  # >> | id | name |
26
26
  # >> |----+-------|
@@ -1,10 +1,10 @@
1
- $LOAD_PATH << "../lib"
2
- require "org_tp"
1
+ $LOAD_PATH << '../lib'
2
+ require 'org_tp'
3
3
 
4
- tp 1, intersection_both: "+"
4
+ tp 1, intersection_both: '+'
5
5
 
6
6
  tp OrgTp::Generator.default_options
7
- OrgTp::Generator.default_options.update(intersection_both: "+")
7
+ OrgTp::Generator.default_options.update(intersection_both: '+')
8
8
  tp OrgTp::Generator.default_options
9
9
 
10
10
  # >> +---+
@@ -1,10 +1,10 @@
1
- $LOAD_PATH << "../lib"
2
- require "active_record"
3
- require "mongoid" # !> method redefined; discarding old as_json
4
- require "org_tp"
1
+ $LOAD_PATH << '../lib'
2
+ require 'active_record'
3
+ require 'mongoid' # !> method redefined; discarding old as_json
4
+ require 'org_tp'
5
5
 
6
6
  Mongo::Logger.logger.level = Logger::INFO
7
- Mongoid::Config.connect_to("test")
7
+ Mongoid::Config.connect_to('test')
8
8
  Mongoid::Clients.default.database.drop
9
9
 
10
10
  class User
@@ -12,7 +12,7 @@ class User
12
12
  field :name, type: String
13
13
  end
14
14
 
15
- ["alice", "bob", "carol"].each { |e| User.create!(name: e) } # !> method redefined; discarding old text_search
15
+ ['alice', 'bob', 'carol'].each { |e| User.create!(name: e) } # !> method redefined; discarding old text_search
16
16
 
17
17
  tp User
18
18
  tp User.first
@@ -1,8 +1,9 @@
1
- $LOAD_PATH << "../lib"
2
- require "tapp"
3
- require "org_tp"
4
- require "rbconfig"
5
-
6
- tp RbConfig::CONFIG # =>
7
-
1
+ $LOAD_PATH << '../lib'
2
+ require 'tapp'
3
+ require 'org_tp'
8
4
 
5
+ 1.tapp(:tp) + 2 # => 3
6
+ # !> `*' interpreted as argument prefix
7
+ # >> |---|
8
+ # >> | 1 |
9
+ # >> |---|
@@ -1,3 +1,3 @@
1
1
  module OrgTp
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
data/org_tp.gemspec CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.author = "akicho8"
10
10
  spec.email = "akicho8@gmail.com"
11
11
  spec.homepage = "https://github.com/akicho8/org_tp"
12
- spec.summary = "OrgTp shows ascii table like emacs org-table for easy reading."
13
- spec.description = "OrgTp shows ascii table like emacs org-table for easy reading."
12
+ spec.summary = "OrgTp shows text table like emacs org-table for easy reading."
13
+ spec.description = "OrgTp shows text table like emacs org-table for easy reading."
14
14
  spec.platform = Gem::Platform::RUBY
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: org_tp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - akicho8
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-07 00:00:00.000000000 Z
11
+ date: 2017-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description: OrgTp shows ascii table like emacs org-table for easy reading.
97
+ description: OrgTp shows text table like emacs org-table for easy reading.
98
98
  email: akicho8@gmail.com
99
99
  executables: []
100
100
  extensions: []
@@ -104,7 +104,7 @@ files:
104
104
  - Gemfile
105
105
  - README.org
106
106
  - Rakefile
107
- - examples/0100_example.rb
107
+ - examples/0100_basic.rb
108
108
  - examples/0110_active_record.rb
109
109
  - examples/0120_default_options.rb
110
110
  - examples/0130_mongoid.rb
@@ -145,7 +145,7 @@ rubyforge_project:
145
145
  rubygems_version: 2.6.11
146
146
  signing_key:
147
147
  specification_version: 4
148
- summary: OrgTp shows ascii table like emacs org-table for easy reading.
148
+ summary: OrgTp shows text table like emacs org-table for easy reading.
149
149
  test_files:
150
150
  - spec/active_record_spec.rb
151
151
  - spec/org_tp_spec.rb