ruby_learner 1.1.10 → 1.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -5
- data/docs/todo/9-27.org +21 -11
- data/lib/datas/install_emacs.sh +23 -0
- data/lib/datas/theme_color.txt +1 -0
- data/lib/ruby_learner/common.rb +15 -0
- data/lib/ruby_learner/ruby_learner.rb +15 -0
- data/lib/ruby_learner/sequential_main.rb +12 -8
- data/lib/ruby_learner/typing_practice.rb +9 -4
- data/lib/ruby_learner/version.rb +1 -1
- data/workshop/emacs.d/{ruby_learner_init.el → black/answer.el} +0 -0
- data/workshop/emacs.d/{init.el → black/init.el} +0 -0
- data/workshop/emacs.d/themes/my-whiteboard-theme.el +97 -0
- data/workshop/emacs.d/white/answer.el +172 -0
- data/workshop/emacs.d/white/init.el +157 -0
- metadata +9 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b758a70837556ede0711af48116828391de4e15e
|
4
|
+
data.tar.gz: 0f7ba7df2afcc732276911d04af17bc5e857da53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20f686d46c02b5cd72360f86c8cda3e6ffdf251876f819273e6155e1673f3a33df30deaf8b82dd9eed99b69e6ee4dcf1a3cef722f5ed7edd7aa73a4359eaf712
|
7
|
+
data.tar.gz: 9f8b65afd8d4b31134db0229976d21dbab7f1f9c7eb3468192086660336780245ef4551b811e5910309ba5ddf9422a29f9ecb10626117ba173c7985a3b3dfa2b
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Add this line to your application's Gemfile:
|
|
11
11
|
gem 'ruby_learner'
|
12
12
|
```
|
13
13
|
|
14
|
-
And then execute:
|
14
|
+
And then execute:
|
15
15
|
|
16
16
|
$ bundle
|
17
17
|
|
@@ -22,10 +22,15 @@ Or install it yourself as:
|
|
22
22
|
## Usage
|
23
23
|
```ruby
|
24
24
|
Usage: ruby_learner [options]
|
25
|
-
Options:
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
Options:
|
26
|
+
-v - check ruby_learner's version
|
27
|
+
emacs_key - confirm emacs key-bindings.
|
28
|
+
sequential_check [section:1~11] [part:1~] - learning drill.
|
29
|
+
sequential_check -drill (-d) - confirm drill numbers
|
30
|
+
sequential_check -next (-n) - learn next to final history
|
31
|
+
restore - check your restore
|
32
|
+
install_emacs - install emacs in your mac
|
33
|
+
theme [black or white] - change ruby_learner's theme
|
29
34
|
```
|
30
35
|
|
31
36
|
In learning in this app, you can choice 3 mode.
|
data/docs/todo/9-27.org
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
* 納期-10/2
|
2
|
-
** 課題文章の文字色が背景色と同化する
|
3
|
-
- 白にしろ
|
4
|
-
** rubyインストールの自動化
|
5
|
-
- emacsのインストール用コマンド
|
6
|
-
- rubyのインストール用コマンド
|
7
|
-
- 小脇さんの自動化ファイルを参考にするべき?
|
8
2
|
** 問題作成
|
9
3
|
- Ruby技術者認定か楽しく学べるRubyの内容を参考
|
10
|
-
*** rubocopのfrozen_string_literalについての対応
|
11
|
-
- .rubocop.ymlに解決コードの書き込みを行う(ファイルの位置は不明)
|
12
|
-
- 各回答用ファイルの先頭に解決コード書き込み
|
13
4
|
** document
|
14
5
|
- エラー対応の記載
|
15
6
|
- 対応パッケージのversionを記載
|
7
|
+
|
8
|
+
* finish
|
9
|
+
** theme変更機能
|
10
|
+
|
11
|
+
** rubyインストールの自動化
|
12
|
+
- emacsのインストール用コマンド
|
13
|
+
- rubyのインストール用コマンド
|
14
|
+
- 小脇さんの自動化ファイルを参考にするべき?
|
15
|
+
|
16
16
|
** 領域の人が使えるようにする
|
17
17
|
- rbenv versions
|
18
18
|
system
|
@@ -20,7 +20,17 @@
|
|
20
20
|
- rbenv local system
|
21
21
|
systemの標準に切り替え(macの標準仕様)
|
22
22
|
そこでgemをインストール
|
23
|
-
|
24
|
-
- bundle exec exe/ruby_learner
|
23
|
+
|
25
24
|
** チェック後にpermission dinied
|
26
25
|
- sshの設定する?
|
26
|
+
|
27
|
+
** localでgem実行
|
28
|
+
- bundle exec exe/ruby_learner
|
29
|
+
|
30
|
+
** rubocopのfrozen_string_literalについての対応
|
31
|
+
- .rubocop.ymlに解決コードの書き込みを行う(ファイルの位置は不明)
|
32
|
+
- 各回答用ファイルの先頭に解決コード書き込み
|
33
|
+
** 課題文章の文字色が背景色と同化する
|
34
|
+
- 白にしろ
|
35
|
+
* file権限の確認
|
36
|
+
- https://do-zan.com/mac-terminal-chmod/
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
echo 'emacs_install start 2-step'
|
4
|
+
cd ~
|
5
|
+
|
6
|
+
echo '1-step: install homebrew?[Y/n]'
|
7
|
+
read ANSWER
|
8
|
+
case $ANSWER in
|
9
|
+
"" | "Y" | "y" )
|
10
|
+
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)";;
|
11
|
+
* ) echo "install homebrew skip";;
|
12
|
+
esac
|
13
|
+
|
14
|
+
echo '2-step: update emacs?[Y/n]'
|
15
|
+
read ANSWER
|
16
|
+
case $ANSWER in
|
17
|
+
"" | "Y" | "y" )
|
18
|
+
brew tap railwaycat/emacsmacport
|
19
|
+
brew install emacs-mac --with-modern-icon;;
|
20
|
+
* ) echo "update emacs skip";;
|
21
|
+
esac
|
22
|
+
|
23
|
+
echo 'emacs_install finish!!'
|
@@ -0,0 +1 @@
|
|
1
|
+
black
|
data/lib/ruby_learner/common.rb
CHANGED
@@ -45,4 +45,19 @@ class Common
|
|
45
45
|
latest_ver = app_vers[0].chomp.gsub(' (', '-').gsub(')','')
|
46
46
|
return latest_ver
|
47
47
|
end
|
48
|
+
|
49
|
+
def change_theme(color: String, gem_dir: String)
|
50
|
+
chmoded = 0
|
51
|
+
file_path = "#{gem_dir}/lib/datas/theme_color.txt"
|
52
|
+
begin
|
53
|
+
File.write(file_path, "#{color}")
|
54
|
+
puts "your ruby_learner's color is #{color}!!"
|
55
|
+
rescue => error
|
56
|
+
system "sudo chmod go+w #{file_path}"
|
57
|
+
chmoded += 1
|
58
|
+
retry if chmoded < 2
|
59
|
+
puts "FileWrite error #{error.message}"
|
60
|
+
puts "you should input $sudo chmod go+w #{file_path}"
|
61
|
+
end
|
62
|
+
end
|
48
63
|
end
|
@@ -52,5 +52,20 @@ module RubyLearner
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
+
desc 'install_emacs','install emacs in your mac'
|
56
|
+
def install_emacs
|
57
|
+
file_path = "#{@gem_dir}/lib/datas/install_emacs.sh"
|
58
|
+
system("sh #{file_path}")
|
59
|
+
end
|
60
|
+
|
61
|
+
desc 'theme [black or white]',"change ruby_learner's theme"
|
62
|
+
def theme(*args)
|
63
|
+
args[0].chomp
|
64
|
+
if args[0] == 'black' || args[0] == 'white'
|
65
|
+
Common.allocate.change_theme(color: args[0], gem_dir: @gem_dir)
|
66
|
+
else
|
67
|
+
puts "you can change the theme_color, only black or white."
|
68
|
+
end
|
69
|
+
end
|
55
70
|
end
|
56
71
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'ruby_learner/typing_practice'
|
2
|
-
|
2
|
+
require 'fileutils'
|
3
3
|
class SequentialMain
|
4
4
|
|
5
5
|
def initialize(gem_dir, workshop_dir)
|
@@ -16,13 +16,17 @@ class SequentialMain
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def write_final_history(sec, par)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
chmoded = 0
|
20
|
+
file_dir = "#{@gem_dir}/lib/datas/final_history_sequential.txt"
|
21
|
+
begin
|
22
|
+
File.write(file_dir, "#{sec}-#{par}")
|
23
|
+
rescue => error
|
24
|
+
system "sudo chmod go+w #{file_dir}"
|
25
|
+
chmoded += 1
|
26
|
+
retry if chmoded < 2
|
27
|
+
puts "FileWrite error #{error.message}"
|
28
|
+
puts "you should input $sudo chmod go+w #{file_dir}"
|
29
|
+
end
|
26
30
|
end
|
27
31
|
|
28
32
|
def drill_contents
|
@@ -7,14 +7,19 @@ class TypingPractice
|
|
7
7
|
def initialize(workshop_dir, gem_dir)
|
8
8
|
@workshop_dir = workshop_dir
|
9
9
|
@gem_dir = gem_dir
|
10
|
-
|
10
|
+
theme_color = ""
|
11
|
+
File.open("#{gem_dir}/lib/datas/theme_color.txt") do |f|
|
12
|
+
theme_color = f.gets.chomp
|
13
|
+
end
|
14
|
+
@emacs_dir = "#{@workshop_dir}/.emacs.d/#{theme_color}"
|
15
|
+
end
|
11
16
|
|
12
17
|
def prac_sequence(mode_dir: String)
|
13
18
|
FileUtils.cp("#{mode_dir}/lib/workplace.rb", "#{@workshop_dir}/lib/workplace.rb")
|
14
19
|
FileUtils.cp("#{mode_dir}/lib/sentence.org", "#{@workshop_dir}/lib/sentence.org")
|
15
20
|
FileUtils.cp("#{mode_dir}/lib/answer.rb", "#{@workshop_dir}/lib/answer.rb")
|
16
21
|
FileUtils.cp("#{mode_dir}/spec/workplace_spec.rb", "#{@workshop_dir}/spec/workplace_spec.rb")
|
17
|
-
system "cd #{@workshop_dir}/lib && emacs -nw -q -l #{@
|
22
|
+
system "cd #{@workshop_dir}/lib && emacs -nw -q -l #{@emacs_dir}/init.el sentence.org workplace.rb"
|
18
23
|
start_time = Time.now
|
19
24
|
typing_discriminant
|
20
25
|
elapsed_time = Common.allocate.time_check(start_time: start_time)
|
@@ -85,9 +90,9 @@ class TypingPractice
|
|
85
90
|
flag_exit = true
|
86
91
|
break
|
87
92
|
elsif select == 'answer'
|
88
|
-
system "cd #{@workshop_dir}/lib && emacs -nw -q -l #{@
|
93
|
+
system "cd #{@workshop_dir}/lib && emacs -nw -q -l #{@emacs_dir}/answer.el sentence.org workplace.rb"
|
89
94
|
else
|
90
|
-
system "cd #{@workshop_dir}/lib && emacs -nw -q -l #{@
|
95
|
+
system "cd #{@workshop_dir}/lib && emacs -nw -q -l #{@emacs_dir}/init.el sentence.org workplace.rb"
|
91
96
|
end
|
92
97
|
end
|
93
98
|
end
|
data/lib/ruby_learner/version.rb
CHANGED
File without changes
|
File without changes
|
@@ -0,0 +1,97 @@
|
|
1
|
+
;;; my-whiteboard-theme.el --- Custom theme for faces
|
2
|
+
|
3
|
+
;; Copyright (C) 2011-2017 Free Software Foundation, Inc.
|
4
|
+
|
5
|
+
;; Author: Scott Frazer <frazer.scott@gmail.com>
|
6
|
+
|
7
|
+
;; This file is part of GNU Emacs.
|
8
|
+
|
9
|
+
;; GNU Emacs is free software: you can redistribute it and/or modify
|
10
|
+
;; it under the terms of the GNU General Public License as published by
|
11
|
+
;; the Free Software Foundation, either version 3 of the License, or
|
12
|
+
;; (at your option) any later version.
|
13
|
+
|
14
|
+
;; GNU Emacs is distributed in the hope that it will be useful,
|
15
|
+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
;; GNU General Public License for more details.
|
18
|
+
|
19
|
+
;; You should have received a copy of the GNU General Public License
|
20
|
+
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
21
|
+
|
22
|
+
;;; Code:
|
23
|
+
|
24
|
+
(deftheme my-whiteboard
|
25
|
+
"Face colors similar to markers on a my-whiteboard.")
|
26
|
+
|
27
|
+
(let ((class '((class color) (min-colors 89))))
|
28
|
+
(custom-theme-set-faces
|
29
|
+
'my-whiteboard
|
30
|
+
`(Info-title-1-face ((,class (:family "helv" :weight bold :height 1.728))))
|
31
|
+
`(Info-title-2-face ((,class (:family "helv" :weight bold :height 1.44))))
|
32
|
+
`(Info-title-3-face ((,class (:family "helv" :weight bold :height 1.2))))
|
33
|
+
`(Info-title-4-face ((,class (:family "helv" :weight bold))))
|
34
|
+
`(compilation-column-number ((,class (:foreground "DarkGreen"))))
|
35
|
+
`(compilation-error ((,class (:foreground "Red1"))))
|
36
|
+
`(compilation-info ((,class (:weight normal :foreground "DeepSkyBlue4"))))
|
37
|
+
`(compilation-line-number ((,class (:foreground "DarkGreen"))))
|
38
|
+
`(cperl-array-face ((,class (:foreground "SlateBlue3"))))
|
39
|
+
`(cperl-hash-face ((,class (:foreground "turquoise3"))))
|
40
|
+
`(cperl-nonoverridable-face ((,class (:foreground "orchid3"))))
|
41
|
+
`(cursor ((,class (:background "Green4"))))
|
42
|
+
`(default ((,class (:background "whitesmoke" :foreground "black"))))
|
43
|
+
`(dired-marked ((,class (:background "dodgerblue3" :foreground "white"))))
|
44
|
+
`(flymake-errline ((,class (:background nil :underline "red"))))
|
45
|
+
`(flymake-warnline ((,class (:background nil :underline "magenta3"))))
|
46
|
+
`(font-lock-builtin-face ((,class (:foreground "DarkOrange3"))))
|
47
|
+
`(font-lock-comment-delimiter-face ((,class (:foreground "gray50"))))
|
48
|
+
`(font-lock-comment-face ((,class (:foreground "gray50"))))
|
49
|
+
`(font-lock-constant-face ((,class (:foreground "DarkOliveGreen4"))))
|
50
|
+
`(font-lock-doc-face ((,class (:foreground "peru"))))
|
51
|
+
`(font-lock-doc-string-face ((,class (:foreground "peru"))))
|
52
|
+
`(font-lock-function-name-face ((,class (:foreground "goldenrod3"))))
|
53
|
+
`(font-lock-keyword-face ((,class (:foreground "DodgerBlue2"))))
|
54
|
+
`(font-lock-preprocessor-face ((,class (:foreground "gold3"))))
|
55
|
+
`(font-lock-reference-face ((,class (:foreground "salmon"))))
|
56
|
+
`(font-lock-regexp-grouping-backslash ((,class (:weight bold))))
|
57
|
+
`(font-lock-regexp-grouping-construct ((,class (:weight bold))))
|
58
|
+
`(font-lock-string-face ((,class (:foreground "burlywood4"))))
|
59
|
+
`(font-lock-type-face ((,class (:foreground "DeepSkyBlue4"))))
|
60
|
+
`(font-lock-variable-name-face ((,class (:foreground "SeaGreen4"))))
|
61
|
+
`(font-lock-warning-face ((,class (:foreground "red"))))
|
62
|
+
`(fringe ((,class (:background "gainsboro"))))
|
63
|
+
`(highlight ((,class (:background "SkyBlue1"))))
|
64
|
+
`(ido-first-match ((,class (:weight normal :foreground "DarkOrange3"))))
|
65
|
+
`(ido-only-match ((,class (:foreground "SeaGreen4"))))
|
66
|
+
`(ido-subdir ((,class (:foreground nil :inherit font-lock-keyword-face))))
|
67
|
+
`(info-header-node ((,class (:foreground "DeepSkyBlue1"))))
|
68
|
+
`(info-header-xref ((,class (:foreground "SeaGreen2"))))
|
69
|
+
`(info-menu-header ((,class (:family "helv" :weight bold))))
|
70
|
+
`(info-node ((,class (:foreground "DeepSkyBlue1"))))
|
71
|
+
`(info-xref ((,class (:foreground "SeaGreen4"))))
|
72
|
+
`(isearch ((,class (:background "coral2" :foreground "white"))))
|
73
|
+
`(isearch-lazy-highlight-face ((,class (:background "coral4" :foreground "white"))))
|
74
|
+
`(lazy-highlight ((,class (:background "cadetblue" :foreground "white"))))
|
75
|
+
`(match ((,class (:background "LightPink1"))))
|
76
|
+
`(minibuffer-prompt ((,class (:foreground "DodgerBlue4"))))
|
77
|
+
`(mode-line ((,class (:background "gray75" :foreground "black" :box (:line-width 1 :style released-button)))))
|
78
|
+
`(mode-line-buffer-id ((,class (:weight bold :background nil :foreground "blue4"))))
|
79
|
+
`(mode-line-inactive ((,class (:background "gray40" :foreground "black" :box (:line-width 1 :color "gray40" :style nil)))))
|
80
|
+
`(outline-1 ((,class (:foreground "Blue3"))))
|
81
|
+
`(outline-2 ((,class (:foreground "DodgerBlue"))))
|
82
|
+
`(outline-3 ((,class (:foreground "SteelBlue"))))
|
83
|
+
`(outline-4 ((,class (:foreground "RoyalBlue"))))
|
84
|
+
`(outline-5 ((,class (:foreground "DeepSkyBlue"))))
|
85
|
+
`(primary-selection ((,class (:background "blue3"))))
|
86
|
+
`(region ((,class (:background "SkyBlue1"))))
|
87
|
+
`(show-paren-match-face ((,class (:background "dodgerblue1" :foreground "white"))))
|
88
|
+
`(show-paren-mismatch-face ((,class (:background "red1" :foreground "white"))))
|
89
|
+
`(warning ((,class (:foreground "Yellow4"))))))
|
90
|
+
|
91
|
+
(provide-theme 'my-whiteboard)
|
92
|
+
|
93
|
+
;; Local Variables:
|
94
|
+
;; no-byte-compile: t
|
95
|
+
;; End:
|
96
|
+
|
97
|
+
;;;my-whiteboard-theme.el ends here
|
@@ -0,0 +1,172 @@
|
|
1
|
+
(require 'package)
|
2
|
+
(add-to-list 'package-archives '("org" . "http:/orgmode.org/elpa/") t)
|
3
|
+
(add-to-list 'package-archives '("org-plus-contrib" . "https:/orgmode.org/elpa/contrib") t)
|
4
|
+
|
5
|
+
(fset 'package-desc-vers 'package--ac-desc-version)
|
6
|
+
(package-initialize)
|
7
|
+
|
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))
|
13
|
+
|
14
|
+
;; 画面分割
|
15
|
+
(setq w (selected-window))
|
16
|
+
(setq w3 (split-window w nil t))
|
17
|
+
;; 画面移動
|
18
|
+
;; (setq windmove-wrap-around t)
|
19
|
+
(setq w2 (split-window w nil nil))
|
20
|
+
;; scratch文字
|
21
|
+
(setq initial-scratch-message "ctrl x & ctrl f 後に answer.rb を入力。")
|
22
|
+
(insert-file-contents "~/.ruby_learner/workshop/lib/answer.rb" nil 0 500)
|
23
|
+
(ruby-mode)
|
24
|
+
(find-file "~/.ruby_learner/workshop/lib/answer.rb")
|
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")
|
28
|
+
(load-theme 'my-whiteboard t)
|
29
|
+
|
30
|
+
;; 起動時にスタートアップ画面を表示しない
|
31
|
+
(setq inhibit-startup-message t)
|
32
|
+
;; 1 行ずつスムーズにスクロールする
|
33
|
+
(setq scroll-step 1)
|
34
|
+
;; 行数を記載する
|
35
|
+
(global-linum-mode t)
|
36
|
+
(setq linum-format "%d")
|
37
|
+
(set-face-attribute 'linum nil
|
38
|
+
:foreground "#000000"
|
39
|
+
:background "#ffffff"
|
40
|
+
:height 0.9)
|
41
|
+
;; 背景色を設定
|
42
|
+
;;(set-face-background 'default "#121212")
|
43
|
+
;; 文字色を設定
|
44
|
+
;;(set-face-foreground 'default "white")
|
45
|
+
;; 言語を日本語に設定
|
46
|
+
(set-language-environment 'Japanese)
|
47
|
+
;; 極力UTF-8とする
|
48
|
+
(prefer-coding-system 'utf-8)
|
49
|
+
|
50
|
+
;; エンコード方式をUTF-8に
|
51
|
+
(set-default-coding-systems 'utf-8)
|
52
|
+
|
53
|
+
(setq coding-system-for-read 'utf-8)
|
54
|
+
(setq coding-system-for-write 'utf-8)
|
55
|
+
(require 'ruby-mode)
|
56
|
+
(defun ruby-mode-set-encoding () nil)
|
57
|
+
;; 対応する括弧を光らせる
|
58
|
+
(show-paren-mode 1)
|
59
|
+
;; 最近使ったファイルの一覧
|
60
|
+
(recentf-mode 1)
|
61
|
+
;; タイトルバーに開いているバッファのパスを表示
|
62
|
+
(setq frame-title-format (format "%%f - Emacs@%s" (system-name)))
|
63
|
+
;; モードラインに時間を表示する
|
64
|
+
(display-time)
|
65
|
+
;; 現在の関数名をモードラインに表示
|
66
|
+
(which-function-mode 1)
|
67
|
+
;; 選択部分のインデント
|
68
|
+
(global-set-key "\C-x\C-i" 'indent-region)
|
69
|
+
|
70
|
+
;; ======================================================================
|
71
|
+
;; Ruby mode
|
72
|
+
;; ======================================================================
|
73
|
+
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
|
74
|
+
(add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
|
75
|
+
(add-to-list 'auto-mode-alist '("\\.gemspec$" . ruby-mode))
|
76
|
+
(add-to-list 'auto-mode-alist '("\\.ru$" . ruby-mode))
|
77
|
+
(add-to-list 'auto-mode-alist '("Gemfile$" . ruby-mode))
|
78
|
+
(add-to-list 'auto-mode-alist '("Guardfile$" . ruby-mode))
|
79
|
+
(add-to-list 'auto-mode-alist '("Guardfile$" . ruby-mode))
|
80
|
+
|
81
|
+
(autoload 'ruby-mode "ruby-mode"
|
82
|
+
"Mode for editing ruby source files" t)
|
83
|
+
(setq auto-mode-alist (append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
|
84
|
+
(setq auto-mode-alist (append '(("\\.ru$" . ruby-mode)) auto-mode-alist))
|
85
|
+
(setq auto-mode-alist (append '(("\\.ru$" . ruby-mode)) auto-mode-alist))
|
86
|
+
(setq interpreter-mode-alist (append '(("ruby" . ruby-mode))
|
87
|
+
interpreter-mode-alist))
|
88
|
+
(prefer-coding-system 'utf-8)
|
89
|
+
(setq coding-system-for-read 'utf-8)
|
90
|
+
(setq coding-system-for-write 'utf-8)
|
91
|
+
(autoload 'run-ruby "inf-ruby"
|
92
|
+
"Run an inferior Ruby process")
|
93
|
+
(autoload 'inf-ruby-keys "inf-ruby"
|
94
|
+
"Set local key defs for inf-ruby in ruby-mode")
|
95
|
+
(add-hook 'ruby-mode-hook
|
96
|
+
'(lambda ()
|
97
|
+
(inf-ruby-keys)))
|
98
|
+
(global-font-lock-mode 1)
|
99
|
+
|
100
|
+
;;;ruby-electric.el --- electric editing commands for ruby files
|
101
|
+
;;(require 'ruby-electric)
|
102
|
+
;;(add-hook 'ruby-mode-hook '(lambda () (ruby-electric-mode t)))
|
103
|
+
|
104
|
+
(setq ruby-indent-level 2)
|
105
|
+
(setq ruby-indent-tabs-mode nil)
|
106
|
+
|
107
|
+
;; ruby code folding from https://coderwall.com/p/u-l0ra/ruby-code-folding-in-emacs
|
108
|
+
(add-hook 'ruby-mode-hook
|
109
|
+
(lambda () (hs-minor-mode)))
|
110
|
+
|
111
|
+
(eval-after-load "hideshow"
|
112
|
+
'(add-to-list 'hs-special-modes-alist
|
113
|
+
`(ruby-mode
|
114
|
+
,(rx (or "def" "class" "module" "do" "{" "[")) ; Block start
|
115
|
+
,(rx (or "}" "]" "end")) ; Block end
|
116
|
+
,(rx (or "#" "=begin")) ; Comment start
|
117
|
+
ruby-forward-sexp nil)))
|
118
|
+
|
119
|
+
(global-set-key (kbd "C-c h") 'hs-hide-block)
|
120
|
+
(global-set-key (kbd "C-c s") 'hs-show-block)
|
121
|
+
|
122
|
+
;; =======================
|
123
|
+
;; org mode
|
124
|
+
;; =======================
|
125
|
+
(require 'ox-latex)
|
126
|
+
;; (require 'ox-bibtex) こいつは無くなったんかな.イランで.
|
127
|
+
|
128
|
+
;; org-modeで行末で折り返しをする
|
129
|
+
(setq org-startup-truncated nil)
|
130
|
+
(unless (boundp 'org-latex-classes)
|
131
|
+
(setq org-latex-classes nil))
|
132
|
+
(add-to-list 'org-latex-classes
|
133
|
+
'("article"
|
134
|
+
"
|
135
|
+
\\documentclass{jsarticle}
|
136
|
+
\\usepackage[dvipdfmx]{graphicx}
|
137
|
+
\\usepackage[utf8]{inputenc}
|
138
|
+
\\usepackage[T1]{fontenc}
|
139
|
+
"
|
140
|
+
("\\section{%s}" . "\\section*{%s}")
|
141
|
+
("\\subsection{%s}" . "\\subsection*{%s}")
|
142
|
+
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
143
|
+
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
144
|
+
("\\subparagraph{%s}" . "\\subparagraph*{%s}")
|
145
|
+
))
|
146
|
+
|
147
|
+
;;; LaTeX 形式のファイル PDF に変換するためのコマンド
|
148
|
+
(setq org-latex-pdf-process
|
149
|
+
'("platex %f"
|
150
|
+
"bibtex %b"
|
151
|
+
"platex %f"
|
152
|
+
"platex %f"
|
153
|
+
"dvipdfmx %b.dvi"))
|
154
|
+
|
155
|
+
(custom-set-variables
|
156
|
+
;; custom-set-variables was added by Custom.
|
157
|
+
;; If you edit it by hand, you could mess it up, so be careful.
|
158
|
+
;; Your init file should contain only one such instance.
|
159
|
+
;; If there is more than one, they won't work right.
|
160
|
+
'(org-latex-pdf-process
|
161
|
+
(quote
|
162
|
+
("pdflatex -interaction nonstopmode -output-directory %o %f"
|
163
|
+
"bibtex %o"
|
164
|
+
"pdflatex -interaction nonstopmode -output-directory %o %f"
|
165
|
+
"pdflatex -interaction nonstopmode -output-directory %o %f")))
|
166
|
+
'(package-selected-packages (quote (haml-mode yaml-mode))))
|
167
|
+
(custom-set-faces
|
168
|
+
;; custom-set-faces was added by Custom.
|
169
|
+
;; If you edit it by hand, you could mess it up, so be careful.
|
170
|
+
;; Your init file should contain only one such instance.
|
171
|
+
;; If there is more than one, they won't work right.
|
172
|
+
)
|
@@ -0,0 +1,157 @@
|
|
1
|
+
(require 'package)
|
2
|
+
(add-to-list 'package-archives '("org" . "http:/orgmode.org/elpa/") t)
|
3
|
+
(add-to-list 'package-archives '("org-plus-contrib" . "https:/orgmode.org/elpa/contrib") t)
|
4
|
+
|
5
|
+
(fset 'package-desc-vers 'package--ac-desc-version)
|
6
|
+
(package-initialize)
|
7
|
+
|
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))
|
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")
|
16
|
+
(load-theme 'my-whiteboard t)
|
17
|
+
|
18
|
+
;; 起動時にスタートアップ画面を表示しない
|
19
|
+
(setq inhibit-startup-message t)
|
20
|
+
;; 1 行ずつスムーズにスクロールする
|
21
|
+
(setq scroll-step 1)
|
22
|
+
;; 行数を記載する
|
23
|
+
(global-linum-mode t)
|
24
|
+
(setq linum-format "%d")
|
25
|
+
(set-face-attribute 'linum nil
|
26
|
+
:foreground "#000000"
|
27
|
+
:background "#ffffff"
|
28
|
+
:height 0.9)
|
29
|
+
;; 背景色を設定
|
30
|
+
;;(set-face-background 'default "brightwhite")
|
31
|
+
;; 文字色を設定
|
32
|
+
;;(set-face-foreground 'default "black")
|
33
|
+
;; 括弧補完
|
34
|
+
;;(electric-pair-mode 1)
|
35
|
+
;; 言語を日本語に設定
|
36
|
+
(set-language-environment 'Japanese)
|
37
|
+
;; 極力UTF-8とする
|
38
|
+
(prefer-coding-system 'utf-8)
|
39
|
+
|
40
|
+
;; エンコード方式をUTF-8に
|
41
|
+
(set-default-coding-systems 'utf-8)
|
42
|
+
|
43
|
+
(setq coding-system-for-read 'utf-8)
|
44
|
+
(setq coding-system-for-write 'utf-8)
|
45
|
+
(require 'ruby-mode)
|
46
|
+
(defun ruby-mode-set-encoding () nil)
|
47
|
+
;; 対応する括弧を光らせる
|
48
|
+
(show-paren-mode 1)
|
49
|
+
;; タイトルバーに開いているバッファのパスを表示
|
50
|
+
(setq frame-title-format (format "%%f - Emacs@%s" (system-name)))
|
51
|
+
;; モードラインに時間を表示する
|
52
|
+
(display-time)
|
53
|
+
;; 現在の関数名をモードラインに表示
|
54
|
+
(which-function-mode 1)
|
55
|
+
;; 選択部分のインデント
|
56
|
+
(global-set-key "\C-x\C-i" 'indent-region)
|
57
|
+
|
58
|
+
;; ======================================================================
|
59
|
+
;; Ruby mode
|
60
|
+
;; ======================================================================
|
61
|
+
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
|
62
|
+
(add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
|
63
|
+
(add-to-list 'auto-mode-alist '("\\.gemspec$" . ruby-mode))
|
64
|
+
(add-to-list 'auto-mode-alist '("\\.ru$" . ruby-mode))
|
65
|
+
(add-to-list 'auto-mode-alist '("Gemfile$" . ruby-mode))
|
66
|
+
(add-to-list 'auto-mode-alist '("Guardfile$" . ruby-mode))
|
67
|
+
(add-to-list 'auto-mode-alist '("Guardfile$" . ruby-mode))
|
68
|
+
|
69
|
+
(autoload 'ruby-mode "ruby-mode"
|
70
|
+
"Mode for editing ruby source files" t)
|
71
|
+
(setq auto-mode-alist (append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
|
72
|
+
(setq auto-mode-alist (append '(("\\.ru$" . ruby-mode)) auto-mode-alist))
|
73
|
+
(setq auto-mode-alist (append '(("\\.ru$" . ruby-mode)) auto-mode-alist))
|
74
|
+
(setq interpreter-mode-alist (append '(("ruby" . ruby-mode))
|
75
|
+
interpreter-mode-alist))
|
76
|
+
(autoload 'run-ruby "inf-ruby"
|
77
|
+
"Run an inferior Ruby process")
|
78
|
+
(autoload 'inf-ruby-keys "inf-ruby"
|
79
|
+
"Set local key defs for inf-ruby in ruby-mode")
|
80
|
+
(add-hook 'ruby-mode-hook
|
81
|
+
'(lambda ()
|
82
|
+
(inf-ruby-keys)))
|
83
|
+
(global-font-lock-mode 1)
|
84
|
+
|
85
|
+
;;;ruby-electric.el --- electric editing commands for ruby files
|
86
|
+
;;(require 'ruby-electric)
|
87
|
+
;;(add-hook 'ruby-mode-hook '(lambda () (ruby-electric-mode t)))
|
88
|
+
|
89
|
+
(setq ruby-indent-level 2)
|
90
|
+
(setq ruby-indent-tabs-mode nil)
|
91
|
+
|
92
|
+
;; ruby code folding from https://coderwall.com/p/u-l0ra/ruby-code-folding-in-emacs
|
93
|
+
(add-hook 'ruby-mode-hook
|
94
|
+
(lambda () (hs-minor-mode)))
|
95
|
+
|
96
|
+
(eval-after-load "hideshow"
|
97
|
+
'(add-to-list 'hs-special-modes-alist
|
98
|
+
`(ruby-mode
|
99
|
+
,(rx (or "def" "class" "module" "do" "{" "[")) ; Block start
|
100
|
+
,(rx (or "}" "]" "end")) ; Block end
|
101
|
+
,(rx (or "#" "=begin")) ; Comment start
|
102
|
+
ruby-forward-sexp nil)))
|
103
|
+
|
104
|
+
(global-set-key (kbd "C-c h") 'hs-hide-block)
|
105
|
+
(global-set-key (kbd "C-c s") 'hs-show-block)
|
106
|
+
|
107
|
+
;; =======================
|
108
|
+
;; org mode
|
109
|
+
;; =======================
|
110
|
+
(require 'ox-latex)
|
111
|
+
;; (require 'ox-bibtex) こいつは無くなったんかな.イランで.
|
112
|
+
|
113
|
+
;; org-modeで行末で折り返しをする
|
114
|
+
(setq org-startup-truncated nil)
|
115
|
+
(unless (boundp 'org-latex-classes)
|
116
|
+
(setq org-latex-classes nil))
|
117
|
+
(add-to-list 'org-latex-classes
|
118
|
+
'("article"
|
119
|
+
"
|
120
|
+
\\documentclass{jsarticle}
|
121
|
+
\\usepackage[dvipdfmx]{graphicx}
|
122
|
+
\\usepackage[utf8]{inputenc}
|
123
|
+
\\usepackage[T1]{fontenc}
|
124
|
+
"
|
125
|
+
("\\section{%s}" . "\\section*{%s}")
|
126
|
+
("\\subsection{%s}" . "\\subsection*{%s}")
|
127
|
+
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
128
|
+
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
129
|
+
("\\subparagraph{%s}" . "\\subparagraph*{%s}")
|
130
|
+
))
|
131
|
+
|
132
|
+
;;; LaTeX 形式のファイル PDF に変換するためのコマンド
|
133
|
+
(setq org-latex-pdf-process
|
134
|
+
'("platex %f"
|
135
|
+
"bibtex %b"
|
136
|
+
"platex %f"
|
137
|
+
"platex %f"
|
138
|
+
"dvipdfmx %b.dvi"))
|
139
|
+
|
140
|
+
(custom-set-variables
|
141
|
+
;; custom-set-variables was added by Custom.
|
142
|
+
;; If you edit it by hand, you could mess it up, so be careful.
|
143
|
+
;; Your init file should contain only one such instance.
|
144
|
+
;; If there is more than one, they won't work right.
|
145
|
+
'(org-latex-pdf-process
|
146
|
+
(quote
|
147
|
+
("pdflatex -interaction nonstopmode -output-directory %o %f"
|
148
|
+
"bibtex %o"
|
149
|
+
"pdflatex -interaction nonstopmode -output-directory %o %f"
|
150
|
+
"pdflatex -interaction nonstopmode -output-directory %o %f")))
|
151
|
+
'(package-selected-packages (quote (haml-mode yaml-mode))))
|
152
|
+
(custom-set-faces
|
153
|
+
;; custom-set-faces was added by Custom.
|
154
|
+
;; If you edit it by hand, you could mess it up, so be careful.
|
155
|
+
;; Your init file should contain only one such instance.
|
156
|
+
;; If there is more than one, they won't work right.
|
157
|
+
)
|
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.
|
4
|
+
version: 1.1.11
|
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-
|
11
|
+
date: 2018-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -120,6 +120,8 @@ files:
|
|
120
120
|
- exe/ruby_learner
|
121
121
|
- lib/datas/emacs_help.org
|
122
122
|
- lib/datas/final_history_sequential.txt
|
123
|
+
- lib/datas/install_emacs.sh
|
124
|
+
- lib/datas/theme_color.txt
|
123
125
|
- lib/ruby_learner/.ruby-version
|
124
126
|
- lib/ruby_learner/common.rb
|
125
127
|
- lib/ruby_learner/ruby_learner.rb
|
@@ -324,7 +326,8 @@ files:
|
|
324
326
|
- takahashi/sample_prog/question/9_1.org
|
325
327
|
- takahashi/sample_prog/question/9_2.org
|
326
328
|
- takahashi/sample_prog/question/9_3.org
|
327
|
-
- workshop/emacs.d/
|
329
|
+
- workshop/emacs.d/black/answer.el
|
330
|
+
- workshop/emacs.d/black/init.el
|
328
331
|
- workshop/emacs.d/inits/line-num.el
|
329
332
|
- workshop/emacs.d/markdown-mode/markdown-mode.el
|
330
333
|
- workshop/emacs.d/ruby-mode/inf-ruby.el
|
@@ -334,11 +337,13 @@ files:
|
|
334
337
|
- workshop/emacs.d/ruby-mode/ruby-style.el
|
335
338
|
- workshop/emacs.d/ruby-mode/rubydb2x.el
|
336
339
|
- workshop/emacs.d/ruby-mode/rubydb3x.el
|
337
|
-
- workshop/emacs.d/ruby_learner_init.el
|
338
340
|
- workshop/emacs.d/themes/dracula-theme.el
|
339
341
|
- workshop/emacs.d/themes/iceberg-theme.el
|
340
342
|
- workshop/emacs.d/themes/my-misterioso-theme.el
|
343
|
+
- workshop/emacs.d/themes/my-whiteboard-theme.el
|
341
344
|
- workshop/emacs.d/themes/my-wombat-theme.el
|
345
|
+
- workshop/emacs.d/white/answer.el
|
346
|
+
- workshop/emacs.d/white/init.el
|
342
347
|
- workshop/lib/answer.rb
|
343
348
|
- workshop/lib/for-def-read.rb
|
344
349
|
- workshop/lib/for-read.txt
|