nb_util 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e89059de6fc29a9e2e4aa276121bce5c2b3561342cde2c5305af6e50223a1e08
4
+ data.tar.gz: 6dd435ec22e2f0b40bae1062e86accdb73aa70ccbca0f8c9d30fd40d99846a32
5
+ SHA512:
6
+ metadata.gz: a15b050b6c57985ce86f798e9af90e13693f37b268ceb1b473efd4f7df99f8761fb0a2c0410aad6e9cfe4800ae8db340645079467d78f3bfd63cede1918cb772
7
+ data.tar.gz: 401ea7f2a31c4cdfa71bb875ac45db1cf41039ba9e6c4c1afd8c642186f884921f6de539336802779601991f079525fccc3a24da7f363cb239debc8a286bdb00
Binary file
@@ -0,0 +1,12 @@
1
+ /.DS_Store/
2
+ /.bundle/
3
+ /.yardoc
4
+ /Gemfile.lock
5
+ /_yardoc/
6
+ /coverage/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /.ipynb_checkpoints/
11
+ *~
12
+ #*
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --format documentation
3
+ --color
@@ -0,0 +1,4 @@
1
+ example_id | status | run_time |
2
+ --------------------------- | ------ | --------------- |
3
+ ./spec/nb_util_spec.rb[1:1] | passed | 0.0024 seconds |
4
+ ./spec/nb_util_spec.rb[1:2] | failed | 0.03039 seconds |
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at ferrari.race.beautiful@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in nb_util.gemspec
6
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 EAGLE
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.
@@ -0,0 +1,38 @@
1
+ # Name
2
+ Nb_Util
3
+
4
+ # Summary
5
+ This gem makes and supplies user specific helps, emulating CUI(CLI) help usage.
6
+
7
+ # Usage
8
+
9
+ ```ruby
10
+ gem 'nb_util'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install nb_util
20
+
21
+
22
+ # Development
23
+
24
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
25
+
26
+ 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`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
27
+
28
+ # Contributing
29
+
30
+ Bug reports and pull requests are welcome on GitHub at https://github.com/EAGLE12/nb_util. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
31
+
32
+ # License
33
+
34
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
35
+
36
+ # Code of Conduct
37
+
38
+ Everyone interacting in the NbUtil project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/EAGLE12/nb_util/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,17 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+ require 'open3'
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ #task :default => :spec
8
+ task :default do
9
+ system 'rake -T'
10
+ end
11
+
12
+ desc "open github origin url"
13
+ task :open_github do
14
+ out, err, status = Open3.capture3("git remote -v")
15
+ url = "https://"+out.match(/^origin\s+git@(.+) \(fetch\)/)[1].gsub(':','/')
16
+ system "open #{url}"
17
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "nb_util"
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(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,228 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {
6
+ "toc": "true"
7
+ },
8
+ "source": [
9
+ "# Table of Contents\n",
10
+ " <p><div class=\"lev2 toc-item\"><a href=\"#step1-方策\" data-toc-modified-id=\"step1-方策-01\"><span class=\"toc-item-num\">0.1&nbsp;&nbsp;</span>step1 方策</a></div><div class=\"lev2 toc-item\"><a href=\"#背景\" data-toc-modified-id=\"背景-02\"><span class=\"toc-item-num\">0.2&nbsp;&nbsp;</span>背景</a></div><div class=\"lev2 toc-item\"><a href=\"#目的\" data-toc-modified-id=\"目的-03\"><span class=\"toc-item-num\">0.3&nbsp;&nbsp;</span>目的</a></div><div class=\"lev2 toc-item\"><a href=\"#手法\" data-toc-modified-id=\"手法-04\"><span class=\"toc-item-num\">0.4&nbsp;&nbsp;</span>手法</a></div><div class=\"lev2 toc-item\"><a href=\"#今後\" data-toc-modified-id=\"今後-05\"><span class=\"toc-item-num\">0.5&nbsp;&nbsp;</span>今後</a></div>"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "markdown",
15
+ "metadata": {},
16
+ "source": [
17
+ "## step1 方策\n",
18
+ "\n",
19
+ "目標:今作ったようなツールをnbutilsとしてrubyのcliで作る\n",
20
+ "\n",
21
+ "仕様:\n",
22
+ "* nbutils rename *.png mid[].png\n",
23
+ "* ...\n",
24
+ "* [github](https://github.com/daddygongon/notebook_root) に入れてるんで,そのあたり読んで,manualを作れ.(10/25発表)"
25
+ ]
26
+ },
27
+ {
28
+ "cell_type": "markdown",
29
+ "metadata": {},
30
+ "source": [
31
+ "## 背景\n",
32
+ "\n",
33
+ "暗黙知の形式知化はいくつものシステムで行われている.\n",
34
+ "ウェブ検索でよく上位に出てくるQiita.comや個人ブログなど,\n",
35
+ "自分の知恵をまとめて提供している.\n",
36
+ "本研究室には,ユーザーメモソフトmy\\_helpというものがある.\n",
37
+ "これは,本研究室西谷が開発したものであり,\n",
38
+ "terminal上で使用するため,\n",
39
+ "自然とCUI(Character User Interface)スキルを身に付けることができる.\n",
40
+ "更に,terminalから離れることなくメモを残すことができるので,\n",
41
+ "書きたい内容を忘れず,すぐに書くことができる.\n",
42
+ "自分自身が大切だと思いメモをした内容は,\n",
43
+ "研究室のメンバーまたは,同じ方向に向かって何かに取り組んでいる者にとっては,\n",
44
+ "有益かつ共有したい情報である.\n",
45
+ "\n",
46
+ "また研究室のメンバーがメモ(暗黙知)をした内容を,\n",
47
+ "ゼミを欠席した者に共有したくても\n",
48
+ "そのメモは所有者個人しか閲覧することができない.\n",
49
+ "更にこのメモを共有するために\n",
50
+ "清書(形式知化)する際,通常メモと異なったフォーマットで記述されるため,\n",
51
+ "一つの箇所に修正があると全てに対応しなければならなくなる.\n",
52
+ "メモの量が,数が少なければ\n",
53
+ "手作業で変換することは可能だが,\n",
54
+ "メモの数が増え,それを手作業でやっていては手間も時間も掛かり,\n",
55
+ "それだけでなく誤りも起きやすくなる.\n",
56
+ "これは,プログラマの心得である,DRY(Don't Repeat Yourself)原則を破ることになる\\cite{pragmatic_prog}.\n",
57
+ "したがって,可能な限り自動化すべきである.\n",
58
+ "\n",
59
+ "![no1](./figs/mid03.png)"
60
+ ]
61
+ },
62
+ {
63
+ "cell_type": "markdown",
64
+ "metadata": {},
65
+ "source": [
66
+ "## 目的\n",
67
+ "本研究では,my¥_helpのデータを\n",
68
+ "Jupyter notebookで扱える形式に自動変換するシステムを構築する.\n",
69
+ "\n",
70
+ "手間と時間が掛からずに,\n",
71
+ "更に間違いなく清書し共有することができるようになることで,\n",
72
+ "その日のゼミの内容を欠席した者にも正確に伝えることができる.\n",
73
+ "加えて,自分が調べた内容も,\n",
74
+ "研究室のメンバーと容易に共有できるようにすることができる."
75
+ ]
76
+ },
77
+ {
78
+ "cell_type": "markdown",
79
+ "metadata": {},
80
+ "source": [
81
+ "## 手法\n",
82
+ "Jupyter notebookは,プログラムに関係するメモや,\n",
83
+ "出力結果をひとまとまりに保存する機能を持ち,\n",
84
+ "Githubなどのサービスで,共有することができるシステムである.\n",
85
+ "ノートブックと呼ばれる形式にドキュメントを作成し,\n",
86
+ "プログラムの記述と実行,メモなどを作成し,\n",
87
+ "ブラウザー上で動作する対話型実行環境である¥cite{Jupyter}.\n",
88
+ "西谷研究室では,\n",
89
+ "個々の研究内容をバックアップするためにGithubを使用しており,\n",
90
+ "西谷からの情報もそこに公開されている.\n",
91
+ "その為,西谷研の学生はどこからでもアクセスし,\n",
92
+ "好きなタイミングで自分の情報を更新することが可能である.\n",
93
+ "そこで,自分のmy¥_helpにあるメモを図1のように\n",
94
+ "my¥_helpからJupyter notebookに変換するシステムを構築することで,\n",
95
+ "メモからノートに自動変換が可能になり,\n",
96
+ "my¥_helpとJupyter notebookの連携ができるようになる.\n",
97
+ "更に,\n",
98
+ "Jupyter notebookにあるGithubとの連携機能を使用することで,\n",
99
+ "今まで個人のメモであったものが,\n",
100
+ "その情報を必要としている複数の人に,\n",
101
+ "共有することができる.\n",
102
+ "\n",
103
+ "my¥_helpのメモは,yaml形式で書かれており,\n",
104
+ "Jupyter notebookはjsonで書かれている.\n",
105
+ "yamlからjsonのフォーマット変換を行うことで,\n",
106
+ "my¥_help to Jupyter notebookを実現する."
107
+ ]
108
+ },
109
+ {
110
+ "cell_type": "markdown",
111
+ "metadata": {},
112
+ "source": [
113
+ "## 今後\n",
114
+ "現状上記の変換コードは,プロトタイプとして変換を確認している.\n",
115
+ "しかし,\n",
116
+ "変換した際に,my¥_helpに書かれているメモをどのようなフォーマットで\n",
117
+ "Jupyter notebookに表示させるかの指定が出来ていない.\n",
118
+ "また,共有に際して便利な機能として,\n",
119
+ "ランク付け,コメント,要望などがある.\n",
120
+ "これらは,Githubが提供するforkおよびpull requestの機能で\n",
121
+ "実現されているため,それらを利用するシステムを今後構築していく.\n",
122
+ "更に,my¥_helpからJupyter notebookへ変換を実行するコマンドが各自の環境に必要である.\n",
123
+ "これらの作業を管理者が行うシステムへ変更していく."
124
+ ]
125
+ },
126
+ {
127
+ "cell_type": "code",
128
+ "execution_count": null,
129
+ "metadata": {
130
+ "collapsed": true
131
+ },
132
+ "outputs": [],
133
+ "source": []
134
+ }
135
+ ],
136
+ "metadata": {
137
+ "kernelspec": {
138
+ "display_name": "Ruby 2.2.2",
139
+ "language": "ruby",
140
+ "name": "ruby"
141
+ },
142
+ "language_info": {
143
+ "file_extension": ".rb",
144
+ "mimetype": "application/x-ruby",
145
+ "name": "ruby",
146
+ "version": "2.2.2"
147
+ },
148
+ "latex_envs": {
149
+ "LaTeX_envs_menu_present": true,
150
+ "autocomplete": true,
151
+ "bibliofile": "biblio.bib",
152
+ "cite_by": "apalike",
153
+ "current_citInitial": 1,
154
+ "eqLabelWithNumbers": true,
155
+ "eqNumInitial": 1,
156
+ "hotkeys": {
157
+ "equation": "Ctrl-E",
158
+ "itemize": "Ctrl-I"
159
+ },
160
+ "labels_anchors": false,
161
+ "latex_user_defs": false,
162
+ "report_style_numbering": false,
163
+ "user_envs_cfg": false
164
+ },
165
+ "toc": {
166
+ "colors": {
167
+ "hover_highlight": "#DAA520",
168
+ "navigate_num": "#000000",
169
+ "navigate_text": "#333333",
170
+ "running_highlight": "#FF0000",
171
+ "selected_highlight": "#FFD700",
172
+ "sidebar_border": "#EEEEEE",
173
+ "wrapper_background": "#FFFFFF"
174
+ },
175
+ "moveMenuLeft": true,
176
+ "nav_menu": {
177
+ "height": "102px",
178
+ "width": "252px"
179
+ },
180
+ "navigate_menu": true,
181
+ "number_sections": true,
182
+ "sideBar": true,
183
+ "threshold": 4,
184
+ "toc_cell": true,
185
+ "toc_position": {
186
+ "height": "814px",
187
+ "left": "0px",
188
+ "right": "1700px",
189
+ "top": "206px",
190
+ "width": "220px"
191
+ },
192
+ "toc_section_display": "block",
193
+ "toc_window_display": true,
194
+ "widenNotebook": false
195
+ },
196
+ "varInspector": {
197
+ "cols": {
198
+ "lenName": 16,
199
+ "lenType": 16,
200
+ "lenVar": 40
201
+ },
202
+ "kernels_config": {
203
+ "python": {
204
+ "delete_cmd_postfix": "",
205
+ "delete_cmd_prefix": "del ",
206
+ "library": "var_list.py",
207
+ "varRefreshCmd": "print(var_dic_list())"
208
+ },
209
+ "r": {
210
+ "delete_cmd_postfix": ") ",
211
+ "delete_cmd_prefix": "rm(",
212
+ "library": "var_list.r",
213
+ "varRefreshCmd": "cat(var_dic_list()) "
214
+ }
215
+ },
216
+ "types_to_exclude": [
217
+ "module",
218
+ "function",
219
+ "builtin_function_or_method",
220
+ "instance",
221
+ "_Feature"
222
+ ],
223
+ "window_display": false
224
+ }
225
+ },
226
+ "nbformat": 4,
227
+ "nbformat_minor": 2
228
+ }