ruby_learner 1.1.5 → 1.1.6

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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/docs/seminar/8-30.org +14 -0
  3. data/docs/seminar/9-16.org +12 -0
  4. data/docs/seminar/ruby_kansai_9-1.org +7 -0
  5. data/docs/thesis/competing_services.org +16 -1
  6. data/docs/thesis/mid_term.pptx +0 -0
  7. data/docs/thesis/~$mid_term.pptx +0 -0
  8. data/docs/todo/9-27.org +10 -0
  9. data/lib/ruby_learner/common.rb +3 -1
  10. data/lib/ruby_learner/ruby_learner.rb +16 -9
  11. data/lib/ruby_learner/sequential_main.rb +3 -3
  12. data/lib/ruby_learner/version.rb +1 -1
  13. data/questions/sequential_check/section_1/part_1/spec/workplace_spec.rb +1 -1
  14. data/questions/sequential_check/section_1/part_2/lib/answer.rb +1 -3
  15. data/questions/sequential_check/section_1/part_2/spec/workplace_spec.rb +2 -2
  16. data/questions/sequential_check/section_1/part_3/spec/workplace_spec.rb +1 -1
  17. data/questions/sequential_check/section_10/part_1/spec/workplace_spec.rb +1 -1
  18. data/questions/sequential_check/section_10/part_2/spec/workplace_spec.rb +2 -2
  19. data/questions/sequential_check/section_11/part_1/spec/workplace_spec.rb +2 -2
  20. data/questions/sequential_check/section_11/part_2/spec/workplace_spec.rb +1 -1
  21. data/questions/sequential_check/section_2/part_1/spec/workplace_spec.rb +2 -2
  22. data/questions/sequential_check/section_2/part_2/spec/workplace_spec.rb +2 -2
  23. data/questions/sequential_check/section_3/part_1/spec/workplace_spec.rb +2 -2
  24. data/questions/sequential_check/section_4/part_1/spec/workplace_spec.rb +2 -2
  25. data/questions/sequential_check/section_5/part_1/spec/workplace_spec.rb +2 -2
  26. data/questions/sequential_check/section_5/part_2/spec/workplace_spec.rb +1 -1
  27. data/questions/sequential_check/section_6/part_1/spec/workplace_spec.rb +2 -2
  28. data/questions/sequential_check/section_6/part_2/spec/workplace_spec.rb +2 -2
  29. data/questions/sequential_check/section_6/part_3/spec/workplace_spec.rb +1 -1
  30. data/questions/sequential_check/section_6/part_4/spec/workplace_spec.rb +1 -1
  31. data/questions/sequential_check/section_7/part_1/spec/workplace_spec.rb +2 -2
  32. data/questions/sequential_check/section_7/part_2/spec/workplace_spec.rb +1 -1
  33. data/questions/sequential_check/section_8/part_1/spec/workplace_spec.rb +2 -2
  34. data/questions/sequential_check/section_9/part_1/spec/workplace_spec.rb +1 -1
  35. data/questions/sequential_check/section_9/part_2/spec/workplace_spec.rb +1 -1
  36. data/questions/sequential_check/section_9/part_3/spec/workplace_spec.rb +1 -1
  37. data/takahashi/docs/README.org +40 -0
  38. data/takahashi/sample_prog/final_check/cut_nisen.rb +20 -0
  39. data/takahashi/sample_prog/final_check/get_nisen.rb +9 -0
  40. data/takahashi/sample_prog/final_check/nisendouka.html +226 -0
  41. data/takahashi/sample_prog/final_check/nisendouka.txt +169 -0
  42. data/takahashi/sample_prog/final_check/simple_match.rb +16 -0
  43. data/takahashi/sample_prog/final_check/simple_match2.rb +18 -0
  44. data/takahashi/sample_prog/final_check/simple_match3.rb +20 -0
  45. data/takahashi/sample_prog/final_check/simple_match4.rb +20 -0
  46. data/takahashi/sample_prog/final_check/test.rb +20 -0
  47. data/takahashi/sample_prog/final_check/test_2.rb +17 -0
  48. data/workshop/emacs.d/init.el +6 -6
  49. data/workshop/emacs.d/ruby_learner_init.el +8 -8
  50. data/workshop/{.rspec → rspec} +1 -0
  51. metadata +18 -3
@@ -0,0 +1,16 @@
1
+ pattern = Regexp.new(ARGV[0])
2
+ filename = ARGV[1]
3
+
4
+ count = 0
5
+
6
+ File.open(filename) do |file|
7
+ file.each_line do |line|
8
+ if pattern =~ line
9
+ line.scan(pattern) do |s|
10
+ count += 1
11
+ end
12
+ print line.gsub(pattern){|str| "<<#{str}>>"}
13
+ end
14
+ end
15
+ end
16
+ puts "count: #{count}"
@@ -0,0 +1,18 @@
1
+ # -*- coding: utf-8 -*-
2
+ # simple_match.rbを、入力したパターンの
3
+ #前後10文字のみ表示するように変更
4
+
5
+ pattern = Regexp.new("(.{10})("+ARGV[0]+")(.{10})")
6
+ filename = ARGV[1]
7
+
8
+ count = 0
9
+
10
+ File.open(filename) do |file|
11
+ file.each_line do |line|
12
+ line.scan(pattern) do |s|
13
+ puts "#{s[0]}<<#{s[1]}>>#{s[2]}"
14
+ count += 1
15
+ end
16
+ end
17
+ end
18
+ puts "count: #{count}"
@@ -0,0 +1,20 @@
1
+ # -*- coding: utf-8 -*-
2
+ #simple_match2.rbの
3
+ #前後10文字の中にあるパターンをカウントしない不具合を解消
4
+
5
+ pattern = Regexp.new(ARGV[0])
6
+ filename = ARGV[1]
7
+
8
+ count = 0
9
+
10
+ File.open(filename) do |file|
11
+ file.each_line do |line|
12
+ line.scan(pattern) do |s|
13
+ pre = $`
14
+ post = $'
15
+ puts "#{pre[-10,10]}<<#{s}>>#{post[0,10]}"
16
+ count += 1
17
+ end
18
+ end
19
+ end
20
+ puts "count: #{count}"
@@ -0,0 +1,20 @@
1
+ # -*- coding: utf-8 -*-
2
+ # 前後の字数を変更できるように
3
+
4
+ pattern = Regexp.new(ARGV[0])
5
+ filename = ARGV[1]
6
+ len = ARGV[2].to_i
7
+
8
+ count = 0
9
+
10
+ File.open(filename) do |file|
11
+ file.each_line do |line|
12
+ line.scan(pattern) do |s|
13
+ pre = $`
14
+ post = $'
15
+ puts "#{pre[-len, len]}<<#{s}>>#{post[0, len]}"
16
+ count += 1
17
+ end
18
+ end
19
+ end
20
+ puts "count: #{count}"
@@ -0,0 +1,20 @@
1
+ # -*- coding: utf-8 -*-
2
+ # 受け取った引数に応じたファイルを読み込んで出力
3
+
4
+ def method2(result)
5
+ filename = "#{result}.rb"
6
+ print File.read(filename)
7
+ end
8
+
9
+ # 受け取った引数を計算するメソッド
10
+
11
+ def method1(num0, num1)
12
+ num0 * num1 % 6
13
+ end
14
+
15
+ num0 = ARGV[0].to_i
16
+ num1 = ARGV[1].to_i
17
+
18
+ result = method1(num0, num1)
19
+
20
+ method2(result)
@@ -0,0 +1,17 @@
1
+ pattern = Regexp.new(ARGV[0])
2
+ filename = ARGV[1]
3
+
4
+ count = 0
5
+
6
+ File.open(filename) do |file|
7
+ file.each_line do |line|
8
+ if pattern =~ line
9
+ line.scan(pattern) do |s|
10
+ count += 1
11
+ end
12
+ print line
13
+ end
14
+ end
15
+ end
16
+
17
+ puts "count: #{count}"
@@ -6,13 +6,13 @@
6
6
  (package-initialize)
7
7
 
8
8
  ;; elファイルの置き場所を設定
9
- (setq load-path (cons "~/ruby_learner/workshop/.emacs.d/inits" load-path))
10
- (setq load-path (cons "~/ruby_learner/workshop/.emacs.d/ruby-mode" load-path))
11
- (setq load-path (cons "~/ruby_learner/workshop/.emacs.d/org-mode" load-path))
12
- (setq load-path (cons "~/ruby_learner/workshop/.emacs.d/themes" load-path))
9
+ (setq load-path (cons "~/.ruby_learner/workshop/.emacs.d/inits" load-path))
10
+ (setq load-path (cons "~/.ruby_learner/workshop/.emacs.d/ruby-mode" load-path))
11
+ (setq load-path (cons "~/.ruby_learner/workshop/.emacs.d/org-mode" load-path))
12
+ (setq load-path (cons "~/.ruby_learner/workshop/.emacs.d/themes" load-path))
13
13
  ;;setting_theme
14
- (add-to-list 'custom-theme-load-path "~/ruby_learner/workshop/.emacs.d/themes")
15
- (setq custom-theme-directory "~/ruby_learner/workshop/.emacs.d/themes")
14
+ (add-to-list 'custom-theme-load-path "~/.ruby_learner/workshop/.emacs.d/themes")
15
+ (setq custom-theme-directory "~/.ruby_learner/workshop/.emacs.d/themes")
16
16
  (load-theme 'my-wombat t)
17
17
 
18
18
  ;; 起動時にスタートアップ画面を表示しない
@@ -6,10 +6,10 @@
6
6
  (package-initialize)
7
7
 
8
8
  ;; elファイルの置き場所を設定
9
- (setq load-path (cons "~/ruby_learner/workshop/.emacs.d/inits" load-path))
10
- (setq load-path (cons "~/ruby_learner/workshop/.emacs.d/ruby-mode" load-path))
11
- (setq load-path (cons "~/ruby_learner/workshop/.emacs.d/org-mode" load-path))
12
- (setq load-path (cons "~/ruby_learner/workshop/.emacs.d/themes" load-path))
9
+ (setq load-path (cons "~/.ruby_learner/workshop/.emacs.d/inits" load-path))
10
+ (setq load-path (cons "~/.ruby_learner/workshop/.emacs.d/ruby-mode" load-path))
11
+ (setq load-path (cons "~/.ruby_learner/workshop/.emacs.d/org-mode" load-path))
12
+ (setq load-path (cons "~/.ruby_learner/workshop/.emacs.d/themes" load-path))
13
13
 
14
14
  ;; 画面分割
15
15
  (setq w (selected-window))
@@ -19,12 +19,12 @@
19
19
  (setq w2 (split-window w nil nil))
20
20
  ;; scratch文字
21
21
  (setq initial-scratch-message "ctrl x & ctrl f 後に answer.rb を入力。")
22
- (insert-file-contents "~/ruby_learner/workshop/lib/answer.rb" nil 0 500)
22
+ (insert-file-contents "~/.ruby_learner/workshop/lib/answer.rb" nil 0 500)
23
23
  (ruby-mode)
24
- (find-file "~/ruby_learner/workshop/lib/answer.rb")
24
+ (find-file "~/.ruby_learner/workshop/lib/answer.rb")
25
25
  ;;setting_theme
26
- (add-to-list 'custom-theme-load-path "~/ruby_learner/workshop/.emacs.d/themes")
27
- (setq custom-theme-directory "~/ruby_learner/workshop/.emacs.d/themes")
26
+ (add-to-list 'custom-theme-load-path "~/.ruby_learner/workshop/.emacs.d/themes")
27
+ (setq custom-theme-directory "~/.ruby_learner/workshop/.emacs.d/themes")
28
28
  (load-theme 'my-wombat t)
29
29
 
30
30
  ;; 起動時にスタートアップ画面を表示しない
@@ -1 +1,2 @@
1
1
  --require spec_helper
2
+ -f p
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_learner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takaki Otsu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-29 00:00:00.000000000 Z
11
+ date: 2018-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,9 +108,14 @@ files:
108
108
  - docs/happy_ruby/c2.ipynb
109
109
  - docs/happy_ruby/c3_4.ipynb
110
110
  - docs/seminar/8-1.org
111
+ - docs/seminar/8-30.org
112
+ - docs/seminar/9-16.org
113
+ - docs/seminar/ruby_kansai_9-1.org
111
114
  - docs/thesis/competing_services.org
112
115
  - docs/thesis/manual.org
113
116
  - docs/thesis/mid_term.pptx
117
+ - docs/thesis/~$mid_term.pptx
118
+ - docs/todo/9-27.org
114
119
  - exe/ruby_learner
115
120
  - lib/datas/emacs_help.org
116
121
  - lib/datas/final_history_sequential.txt
@@ -284,6 +289,16 @@ files:
284
289
  - takahashi/sample_prog/answer/9_2.rb~
285
290
  - takahashi/sample_prog/answer/9_3.rb
286
291
  - takahashi/sample_prog/answer/hello.rb
292
+ - takahashi/sample_prog/final_check/cut_nisen.rb
293
+ - takahashi/sample_prog/final_check/get_nisen.rb
294
+ - takahashi/sample_prog/final_check/nisendouka.html
295
+ - takahashi/sample_prog/final_check/nisendouka.txt
296
+ - takahashi/sample_prog/final_check/simple_match.rb
297
+ - takahashi/sample_prog/final_check/simple_match2.rb
298
+ - takahashi/sample_prog/final_check/simple_match3.rb
299
+ - takahashi/sample_prog/final_check/simple_match4.rb
300
+ - takahashi/sample_prog/final_check/test.rb
301
+ - takahashi/sample_prog/final_check/test_2.rb
287
302
  - takahashi/sample_prog/question/10_1.org
288
303
  - takahashi/sample_prog/question/10_2.org
289
304
  - takahashi/sample_prog/question/11_1.org
@@ -307,7 +322,6 @@ files:
307
322
  - takahashi/sample_prog/question/9_1.org
308
323
  - takahashi/sample_prog/question/9_2.org
309
324
  - takahashi/sample_prog/question/9_3.org
310
- - workshop/.rspec
311
325
  - workshop/emacs.d/init.el
312
326
  - workshop/emacs.d/inits/line-num.el
313
327
  - workshop/emacs.d/markdown-mode/markdown-mode.el
@@ -329,6 +343,7 @@ files:
329
343
  - workshop/lib/sentence.org
330
344
  - workshop/lib/workplace.rb
331
345
  - workshop/restore/empty.rb
346
+ - workshop/rspec
332
347
  - workshop/spec/spec_helper.rb
333
348
  - workshop/spec/workplace_spec.rb
334
349
  homepage: ''