riven 1.1.4 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/Gemfile.lock +2 -5
  4. data/README.md +20 -153
  5. data/bin/riven +17 -18
  6. data/doc/chapters/1-what-is-riven/1-scenario-a.md +12 -0
  7. data/doc/chapters/1-what-is-riven/2-scenario-b.md +8 -0
  8. data/doc/chapters/1-what-is-riven/3-what-is-riven-not.md +16 -0
  9. data/doc/chapters/1-what-is-riven/4-why-was-riven-created.md +35 -0
  10. data/doc/chapters/1-what-is-riven/5-how-can-i-support-riven.md +7 -0
  11. data/doc/chapters/1-what-is-riven/index.md +15 -0
  12. data/doc/chapters/2-setup/1-prerequisites.md +49 -0
  13. data/doc/chapters/2-setup/2-installation.md +17 -0
  14. data/doc/chapters/2-setup/index.md +6 -0
  15. data/doc/chapters/3-basics/1-single-file.md +19 -0
  16. data/doc/chapters/3-basics/2-multiple-files.md +65 -0
  17. data/doc/chapters/3-basics/3-structured-files.md +55 -0
  18. data/doc/chapters/3-basics/4-config-file.md +63 -0
  19. data/doc/chapters/3-basics/index.md +17 -0
  20. data/doc/chapters/4-advanced-usage/1-css.md +34 -0
  21. data/doc/chapters/4-advanced-usage/2-table-of-contents.md +11 -0
  22. data/doc/chapters/4-advanced-usage/3-cover.md +10 -0
  23. data/doc/chapters/4-advanced-usage/4-syntax-highlighting.md +23 -0
  24. data/doc/chapters/4-advanced-usage/index.md +10 -0
  25. data/doc/cover.md +37 -0
  26. data/doc/img/cover.png +0 -0
  27. data/doc/index.md +4 -0
  28. data/doc/riven.pdf +0 -0
  29. data/doc/riven.yml +10 -0
  30. data/doc/style.css +21 -0
  31. data/lib/riven/config.rb +122 -0
  32. data/lib/riven/html_generator.rb +4 -4
  33. data/lib/riven/markup_file.rb +1 -1
  34. data/lib/riven/opt_parser.rb +48 -33
  35. data/lib/riven/version.rb +1 -1
  36. data/lib/riven/wkhtmltopdf.rb +7 -7
  37. metadata +28 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 041073e77332410b3beec7c6f5e2510020034e95
4
- data.tar.gz: 6e39be4418714492d5ca7f2c99c0dd0bd3f11b72
3
+ metadata.gz: 1db4e60b13dcba67d9b6bd7fd7708f395a6d26c2
4
+ data.tar.gz: b285fa0211720e1c5ab51192cc2cf87843880fa8
5
5
  SHA512:
6
- metadata.gz: 9d112db24fac421b1d166f181c7660368931eacfe7e5158c2c61997585c26eff6764626af9e0080ffc6c178e39634e18671b19abd14cf017d26677a3cb6a207a
7
- data.tar.gz: 594129231909ba0208df4cf014534660faf61dff2751d5b6eb6b4a480f87f2eb662b56226e3659e7eb741901c9cb1688055062251aee9ebd9aa66afa0a3ee257
6
+ metadata.gz: 7d9c706678b7e24eab37c4d24f038c7e6124dbcb652fc26d720abe12681fc92c0a5334ded8cb52cdd7542ba7251fcd762eb94155d2f48f2d7e610ae8ac27264b
7
+ data.tar.gz: be65f9e746417996f225a886ab531c99e4871d90f15f8f1bb8fd75c866b9b520541c22986f7db1391e6b42ae461e5f2edbec79753511e3c23a36a6fc60ea2cb7
data/.gitignore CHANGED
@@ -17,7 +17,6 @@ build/
17
17
  ## Documentation cache and generated files:
18
18
  /.yardoc/
19
19
  /_yardoc/
20
- /doc/
21
20
  /rdoc/
22
21
 
23
22
  ## Environment normalisation:
@@ -32,3 +31,6 @@ build/
32
31
 
33
32
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
33
  .rvmrc
34
+
35
+ # RubyMine
36
+ /.idea
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- riven (1.1.2)
4
+ riven (1.2.0)
5
5
  coderay (~> 1.1)
6
6
  redcarpet (~> 3.2)
7
7
 
@@ -10,7 +10,7 @@ GEM
10
10
  specs:
11
11
  coderay (1.1.0)
12
12
  rake (10.4.2)
13
- redcarpet (3.3.1)
13
+ redcarpet (3.2.3)
14
14
 
15
15
  PLATFORMS
16
16
  ruby
@@ -19,6 +19,3 @@ DEPENDENCIES
19
19
  bundler (~> 1.8)
20
20
  rake (~> 10.4)
21
21
  riven!
22
-
23
- BUNDLED WITH
24
- 1.10.3
data/README.md CHANGED
@@ -1,172 +1,39 @@
1
1
  # Riven
2
2
 
3
- Converts GitHub Flavored Markdown files to PDFs! Write documentations, books, reports and documents with your editor.
4
- Publish them as PDF! It's that simple and even more powerful.
3
+ Riven converts Markdown files into PDF documents! Write documentations, books, reports, everything with your
4
+ favorite text editor and publish them as PDF - It's that simple and even more powerful.
5
5
 
6
+ **Feature highlights:**
6
7
 
7
- Feature highlights:
8
-
9
- - Riven Extended Markdown featuring includes: Structure you work!
8
+ - Riven Extended Markdown (it's GitHub Flavored Markdown but with more features!)
9
+ - Include directives: Structure your document!
10
10
  - Generates well readable, optimized, beautiful looking PDFs
11
11
  - Style your PDF via CSS
12
12
  - Define a special and nice looking cover page
13
13
  - Auto generated table of contents
14
- - Syntax Highlighting with GitHub like theme
15
- - Page numbers
14
+ - Syntax Highlighting with GitHub theme
15
+ - Page footer with page numbers
16
16
  - Smart directory based file merging and output file naming
17
17
 
18
18
 
19
- ## Prerequisites
20
-
21
- You need `wkhtmltopdf` in order to generate PDFs, since that's the PDF generator backend for riven. You should use the
22
- QT patched version of `wkhtmltopdf` to get all the features of riven. You may also use the version without patched qt,
23
- but that will disable the following features of riven: Page numbers, table of contents, covers.
24
-
25
- - If you got Arch Linux, you can just install the packages `wkhtmltopdf-static`and `icu48` from the AUR.
26
-
27
- - If you got another Linux Distribution (like Ubuntu) or OSX you have compile `wkhtmltopdf` from the sources. See http://natepinchot.com/2014/01/31/building-static-wkhtmltopdf/. This may take some time: On my i7, 16GB RAM, SSD
28
- Notebook it took about 20 minutes.
29
-
30
- - Otherwise, you should download `wkhtmltopdf` from the [official website](http://wkhtmltopdf.org/downloads.html).
31
-
32
- After that, make sure you can execute the `wkhtmltopdf` command in your shell:
33
-
34
- ```bash
35
- $ wkhtmltopdf -V
36
- ```
37
-
38
- If it works, everything is nice and you may proceed with the next step. If not, please make sure, `wkhtmltopdf` is
39
- correctly installed and the executable is within your `PATH`.
40
-
41
-
42
- ## Installation
43
-
44
- Simple as usual:
45
-
46
- ```bash
47
- $ gem install riven
48
- ```
49
-
50
-
51
- ## Usage
52
-
53
- Riven is designed to create documents out of a bunch of markdown files. So it may take a single markdown file or a
54
- directory with some markdown files inside. Consider that the files are merged in alphabetical order if you provide a
55
- folder. Just take a look at the following examples.
56
-
57
-
58
- ### Single file to PDF
59
-
60
- This will take your `example.md` and generate a `example.pdf` in the same directory:
61
-
62
- ```bash
63
- $ riven example.md
64
- ```
65
-
66
-
67
- ### Multiple files
68
-
69
- This will take your `example-1.md` and `example-2.md` and generate a `awesome.pdf` in the same directory:
70
-
71
- ```bash
72
- $ riven -o awesome.pdf example-1.md example-2.pdf
73
- ```
74
-
75
-
76
- ### A directory
77
-
78
- This will take your `documentation` directory with all it's files and generate a `documentation.pdf` (the name is
79
- guessed from the directory name, but you may also specify a output file name via the `-o` param) in the same
80
- directory:
81
-
82
- ```bash
83
- $ ls
84
- documentation/
85
-
86
- $ ls documentation/
87
- chapter-1-preface.md
88
- chapter-2-general.md
89
- chapter-3-admin-gui.md
90
- chapter-4-commandline-interface.md
91
- chapter-5-api.md
92
-
93
- $ riven documentation/
94
-
95
- $ ls
96
- documentation.pdf
97
- documentation/
98
- ```
99
-
100
-
101
- ### Structure via includes
102
-
103
- You may also structure your document via includes. Just define a main file and you may define as many include directives
104
- within that file and any other files (even in subdirectories) as you want.
105
-
106
- **index.md**
107
-
108
- ```md
109
- ## Just a example
110
-
111
- This is a include:
112
-
113
- <<[ another_file.md ]
114
- ```
115
-
116
- **another_file.md**
117
-
118
- ```md
119
- More **content** in this file.
120
- ```
121
-
122
- Generate the PDF via:
123
-
124
- ```bash
125
- $ riven -o awesome.pdf index.md
126
- ```
127
-
128
-
129
- ## Additional Features
130
-
131
- ### Custom CSS
132
-
133
- You may give riven an additional CSS file with the `-s` param:
134
-
135
- ```bash
136
- $ riven -s doc.css documentation/
137
- ```
138
-
139
- unfortunately this CSS doesn't affect the table of contents currently, sorry for that.
140
-
141
-
142
- ### Cover
143
-
144
- You may give riven a cover MD file via the `-c` param, which will be prepended and not provided with a page number.
145
-
146
- ```bash
147
- $ riven -c documentation/cover.md documentation/
148
- ```
149
-
19
+ ## Example PDF
150
20
 
151
- ### Syntax highlighting
21
+ The Riven manual itself is generated by Riven.
22
+ **[See the result](https://github.com/phortx/riven/blob/master/doc/riven.pdf)**!
152
23
 
153
- Syntax highlighting just works as usual:
154
24
 
155
- <pre lang="no-highlight">
156
- ```ruby
157
- def foo
158
- puts 'bar'
159
- end
160
- ```
161
- </pre>
25
+ ## Documentation
162
26
 
163
- The syntax highlightning is powered by [coderay](https://github.com/rubychan/coderay) and is using a [github theme](https://github.com/pie4dan/CodeRay-GitHub-Theme).
27
+ Read the user manual of Riven:
164
28
 
29
+ - [Online Version on GitHub](https://github.com/phortx/riven/blob/master/doc/chapters/)
30
+ - [Chapter 1: What is Riven?](https://github.com/phortx/riven/blob/master/doc/chapters/1-what-is-riven/)
31
+ - [Chapter 2: Setup Riven](https://github.com/phortx/riven/blob/master/doc/chapters/2-setup/)
32
+ - [Chapter 3: Learn the basics](https://github.com/phortx/riven/blob/master/doc/chapters/3-basics/)
33
+ - [Chapter 4: Advanced topics](https://github.com/phortx/riven/blob/master/doc/chapters/4-advanced-usage/)
34
+ - [PDF Version](https://github.com/phortx/riven/blob/master/doc/riven.pdf)
165
35
 
166
- ### Table of Contents
167
36
 
168
- For an automatic generated table of contents after the cover, just add the `-t` param and provide a headline for the table of contents:
37
+ ## Contribute
169
38
 
170
- ```bash
171
- $ riven -t "Contents" -c documentation/cover.md documentation/
172
- ```
39
+ Riven just started and there's a lot to do. Contributions are welcome! Feel free to send pull requests :)
data/bin/riven CHANGED
@@ -13,35 +13,34 @@ Riven::Wkhtmltopdf.check_installation
13
13
 
14
14
 
15
15
  ## Step 2: Parse command line options
16
- options = Riven::OptParser.options
17
- files = Riven::OptParser.files(options)
16
+ config = Riven::OptParser.get_config
18
17
 
19
18
 
20
19
  ## Step 3: Change dir if directory is given to ensure the image pathes work
21
- unless options[:dir_given] === false
20
+ unless config.dir_given === false
22
21
  working_dir = Dir.pwd
23
- Dir.chdir options[:dir_given]
22
+ Dir.chdir config.dir_given
24
23
  end
25
24
 
26
25
 
27
26
  ## Step 4: Generate HTML for cover
28
- unless options[:cover_file] === ''
29
- cover_markup = Riven::MarkupFile.read_cover(options[:cover_file])
27
+ unless config.cover_file === ''
28
+ cover_markup = Riven::MarkupFile.read_cover(config.cover_file)
30
29
  end
31
- cover_generator = Riven::HTMLGenerator.new('_riven_cover_tmp_file.html', cover_markup || '', options)
30
+ cover_generator = Riven::HTMLGenerator.new('_riven_cover_tmp_file.html', cover_markup || '', config)
32
31
 
33
32
 
34
33
  ## Step 5: Generate HTML for main document
35
- markup = Riven::MarkupFile.read_all(files, options[:cover_file])
36
- generator = Riven::HTMLGenerator.new('_riven_tmp_file.html', markup, options)
34
+ markup = Riven::MarkupFile.read_all(config.files, config.cover_file)
35
+ generator = Riven::HTMLGenerator.new('_riven_tmp_file.html', markup, config)
37
36
 
38
37
 
39
38
  ## Step 6: Determine PDF file name
40
- output_file = options[:output_file]
39
+ output_file = config.pdf_output_file
41
40
 
42
41
  if output_file.empty?
43
- unless options[:dir_given] === false
44
- output_file = options[:dir_given] + '.pdf'
42
+ unless config.dir_given === false
43
+ output_file = config.dir_given + '.pdf'
45
44
  else
46
45
  puts "No output file name given. Please specify output file name via -o param."
47
46
  generator.close!
@@ -50,12 +49,12 @@ if output_file.empty?
50
49
  end
51
50
  end
52
51
 
53
- puts "Output file: #{output_file}" if options[:verbose]
52
+ puts "Output file: #{output_file}" if config.dir_given
54
53
 
55
54
 
56
55
  ## Step 7: Generate the PDF file from HTML file
57
- output = Riven::Wkhtmltopdf.generate_pdf(generator.html_file, cover_generator.html_file, output_file, options)
58
- puts output if options[:verbose]
56
+ output = Riven::Wkhtmltopdf.generate_pdf(generator.html_file, cover_generator.html_file, output_file, config)
57
+ puts output if config.verbose
59
58
 
60
59
 
61
60
  ## Step 8: Close the generators
@@ -64,13 +63,13 @@ cover_generator.close!
64
63
 
65
64
 
66
65
  ## Step 9: Dump the HTML code if requested
67
- puts generator.html if options[:dump_html]
68
- puts cover_generator.html if options[:dump_cover_html]
66
+ puts generator.html if config.dump_html
67
+ puts cover_generator.html if config.dump_cover_html
69
68
 
70
69
 
71
70
  ## Step 10: If we changed the directory before, the PDF file is now located in the wrong directory,
72
71
  ## so wie have to move it
73
- unless options[:dir_given] === false
72
+ unless config.dir_given === false
74
73
  require 'fileutils'
75
74
  FileUtils.mv output_file, working_dir + '/' + output_file
76
75
  end
@@ -0,0 +1,12 @@
1
+ ## 1.1. Scenario A: You want to write a book
2
+
3
+ You are a bit familiar with Linux or OSX. Maybe you even know what markdown is, but it's okay if you don't know markdown.
4
+ And you want to write a book for some reason. Maybe a subject book, maybe a novel or maybe some fanfiction for whatever
5
+ you like. But you have no idea of LaTeX and you don't want to write it in LibreOffice or some other kind of office
6
+ suite for some reason. Maybe because you want to have full control over all formatings and you love a text editor like
7
+ atom, sublime editor or vim. You also know HTML and CSS maybe, but you don't want to use it since it's to much code to
8
+ write and you have to test to it too often in you browser while writing.
9
+
10
+ What you want is just a very simple and lean tool chain which let's you write a very minimalistic markup in your
11
+ favorite text editor and compiles everything in a beautiful, readable and stylish PDF (and mobi, epub etc in the
12
+ future). And if something doesn't fit your requirements, you just change it via CSS or configuration.
@@ -0,0 +1,8 @@
1
+ ## 1.2. Scenario B: Your a coder and want to document your software
2
+
3
+ You have a software project, you're familiar with Linux or OSX, HTML, CSS, Markdown and others. And you want to document
4
+ your software in a plain text readable format. But you also want a very simple and lean tool chain which compiles
5
+ everything in a beautiful, readable and stylish PDF (and mobi, epub etc in the future). And if something doesn't fit
6
+ your requirements, you just change it via CSS or configuration. Also you want to use your favorite text editor like atom, sublime editor or vim but don't want to write the documentation in HTML and CSS since it's to much code to write and you
7
+ have to test to it too often in you browser while writing. And you don't want to write it in LibreOffice or some other
8
+ kind of office suite for some reason. For example because you're working in a team and you're using some kind of version control system like git. Therefore a plain text format is much more beneficial then a binary blob.
@@ -0,0 +1,16 @@
1
+ ## 1.3. What is Riven not?
2
+
3
+ Now you may have a clue what Riven is. But it's maybe even more important to understand what riven actually is **not**.
4
+ Well Riven is neither a editor like atom nor a typesetting system like TeX nor a markup language like markdown or
5
+ reStructuredText nor a office suite nor a web based service like [Lit Lift](http://www.litlift.com/) or
6
+ [Fast Pencil](http://www.fastpencil.com/). It's just a command line tool which transforms markdown files into PDF
7
+ documents (and HTML, mobi, ePub etc in the future). So it's more comparable with the
8
+ [sphinx documentation generator](http://sphinx-doc.org/).
9
+
10
+ Also Riven doesn't run on windows machines. Sorry for that.
11
+
12
+ Additionally Riven lacks some features you may know from sphinx. For example HTML site generation is not there (yet!)
13
+ and Riven is (yet!) not able to generate man pages, ePub and mobi formats. But those features are planned and will be
14
+ added in the future. Also Riven intentionally doesn't generate chapter numeration like you may know from sphinx. You
15
+ have to do it on your own (and you can just omit it if you don't like it or even mix it up). But maybe there will be an
16
+ option in the future which makes Riven to auto generate chapter numbers for you.
@@ -0,0 +1,35 @@
1
+ ## 1.4. Why was Riven created?
2
+
3
+ I've two hobbies. Ok I got more hobbies, but only two of them are relevant for Riven.
4
+
5
+ One is programming. I code a lot. Additionally it's my job so I code even more. And a good programmer documents
6
+ his software. In my company we're working on a high innovative CMS with a very versatile framework which allows us to
7
+ implement nearly every kind of project. We had to document that framework in some way for the other developers who
8
+ would use it and implement the customer projects based on the CMS. One requirement to the documentation was portability.
9
+ It should be readable on the PC, on Tablets and it should be printable. As we started to write the documentation, we
10
+ used OpenOffice and saved it as a ODT file which is basically a ZIP-File with some XML within. In order words: We had a
11
+ big binary file in our git repository. It doesn't took a long time until we had merge conflicts due the fact that up to
12
+ three people have been working on the document at the same time. And merging a big binary blob doesn't make fun. So I
13
+ wanted to switch to another tool chain to write the documentation. The obvious suggest was HTML of course. But to write
14
+ HTML is much work, we didn't want to do that. We know HTML, since we're web developers, but we wanted a solution which
15
+ would be more lean and allows a faster workflow without much testing. Of course we could have used our CMS, but we
16
+ wanted to have the documentation in our git repository. However we wanted to use plain text to write your documentation
17
+ and we wanted a PDF as a result. Unfortunately there wasn't any good comparable tool that time.
18
+
19
+ My second hobby is Pen and Paper. Dungeons and Dragons, you know (Cthulu, Aborea and Pathfinder to be exact). And I was
20
+ writing a campaign. I was writing that campaign in markdown, because I love my editor and I wanted to use git to manage
21
+ everything since GitLab renders markdown nicely. Now I needed a build chain to produce a PDF in order to have one
22
+ document which can be printed or sent via mail.
23
+
24
+ For these both use cases I hacked the initial proof of concept version of a md2pdf ruby script, which worked pretty
25
+ well. But I wanted some additional features like styling of the PDF via CSS, a cover page, syntax highlighting and some
26
+ other stuff. So the script started to grow to a bigger project. After some time I've renamed it to riven, since, well, it
27
+ sounds cool. And yes it's reference to the Myst series.
28
+
29
+ In order to keep even big documents structured and clear, riven 1.1.0 introduced the *include* syntax, which allows
30
+ a better split up of the content over many files, subdirectories and allows an easier refactoring of the chapters.
31
+
32
+ Riven solved both use cases very well. I'm using riven to write both large Pen and Paper campaings and some small
33
+ documents. Either quick or within weeks of hard work. Both cases produce a nice PDF. Today the CMS framework
34
+ documentation of my company includes over 200 PDF pages generated out of 9500 lines of markdown, which are changed on a
35
+ weekly basis and Riven does a nice job.
@@ -0,0 +1,7 @@
1
+ ## 1.5. How can I support Riven?
2
+
3
+ Riven is a MIT licensed Open Source project hosted on GitHub. Just vist https://github.com/phortx/riven. You'll find
4
+ the issues section there containing all bugs and feature requests. Also you can fork the project to send pull requests.
5
+ Feel free to contribute code, documentation or bugfixes!
6
+
7
+ If you find any bugs, please open a new issue in the issue tracker and I'll try to fix it.
@@ -0,0 +1,15 @@
1
+ # 1. What is Riven?
2
+
3
+ In one sentence: Riven is a command line tool, which converts a bunch of markdown files into a PDF file.
4
+
5
+ **The question is: Why would you do that?**
6
+
7
+ There are several scenarios where the usage of a tool like Riven would make a lot of sense for you. Let's take a look
8
+ at some of them:
9
+
10
+ <<[ 1-scenario-a.md ]
11
+ <<[ 2-scenario-b.md ]
12
+
13
+ <<[ 3-what-is-riven-not.md ]
14
+ <<[ 4-why-was-riven-created.md ]
15
+ <<[ 5-how-can-i-support-riven.md ]
@@ -0,0 +1,49 @@
1
+ ## 2.1. Prerequisites
2
+
3
+ Riven comes with some dependencies, which you have to statisfy before you can start to use it. But no panic it's not
4
+ that hard.
5
+
6
+ First of all you'll need [wkhtmltopdf](https://github.com/wkhtmltopdf/wkhtmltopdf/) in order to generate PDFs, since
7
+ that's the PDF generator backend of Riven. And you should use the QT patched version of `wkhtmltopdf` to get all the
8
+ features of riven. You may also use the version without patched qt, but that will disable the following features of
9
+ riven: Page numbers, table of contents and covers.
10
+
11
+ All right, Let's go ...
12
+
13
+ - If you got Arch Linux, you can just install the packages `wkhtmltopdf-static`and `icu48` from the AUR and you're done.
14
+ Pretty easy, isn't it?
15
+
16
+ - If you got another Linux Distribution (like Ubuntu) or OSX you have to compile `wkhtmltopdf` from the sources. See
17
+ http://natepinchot.com/2014/01/31/building-static-wkhtmltopdf/ for details. This may take some time: On my i7 it takes
18
+ about 20 minutes.
19
+
20
+ - Otherwise, you can download `wkhtmltopdf` from the [official website](http://wkhtmltopdf.org/downloads.html).
21
+
22
+ I know, that part is somewhat uncomfortable and this will change in the future. Either wkhtmltopdf will be automatically
23
+ installed with the gem or riven comes with a Docker container. However, the installation will be easier in the future.
24
+
25
+ After wkhtmltopdf is compiled, make sure you can execute the `wkhtmltopdf` command in your shell:
26
+
27
+ ```bash
28
+ $ wkhtmltopdf -V
29
+ ```
30
+
31
+ If it works, everything is nice and you may proceed with the next step. If not, please make sure, `wkhtmltopdf` is
32
+ correctly installed and the executable is within your `PATH`.
33
+
34
+ In the second step, we need ruby. I recommend you to use [RVM](https://rvm.io) to install Ruby. It's pretty simple:
35
+
36
+ ```bash
37
+ $ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
38
+ $ \curl -sSL https://get.rvm.io | bash -s stable
39
+ $ rvm install 2.2.3
40
+ $ rvm --default use 2.2.3
41
+ ```
42
+
43
+ After that you should be able to use ruby:
44
+
45
+ ```bash
46
+ $ ruby -v
47
+ ```
48
+
49
+ If so, we're ready to install Riven in the next chapter!