rundoc 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/check_changelog.yml +13 -0
- data/CHANGELOG.md +5 -0
- data/Dockerfile +24 -0
- data/lib/rundoc/code_command/background/start.rb +4 -0
- data/lib/rundoc/code_command/pipe.rb +18 -5
- data/lib/rundoc/version.rb +1 -1
- data/rundoc.gemspec +1 -0
- data/test/fixtures/rails_5/rundoc.md +8 -2
- data/test/fixtures/rails_6/rundoc.md +20 -7
- data/test/rundoc/parser_test.rb +0 -1
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da3a985092d1a4964518696470e3caffbccfa38fb4c77babd3bb9db3019574f8
|
4
|
+
data.tar.gz: b10a337ee209e1b915b2bbd806c5e20a39919bb4768e015f3cd3b9ced7690608
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67f0fc97aabfb49844520018ec31b94ffa9d99472115a1c4d32f19a9f4d352c2474e5b3120769000322b042fb7ac8ea302170c0fc6632e178f2760b1d4ef6ae3
|
7
|
+
data.tar.gz: 04bf8538b5087638a5ff731154ea5c5c3c189bd8ea321d0d2b7690acb604e4a7120dd1adf0f9566fe91c225b9a7e0a634cb642de16e0919c3fedf43e893c12b6
|
@@ -0,0 +1,13 @@
|
|
1
|
+
name: Check Changelog
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
types: [opened, reopened, edited, synchronize]
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v1
|
11
|
+
- name: Check that CHANGELOG is touched
|
12
|
+
run: |
|
13
|
+
cat $GITHUB_EVENT_PATH | jq .pull_request.title | grep -i '\[\(\(changelog skip\)\|\(ci skip\)\)\]' || git diff remotes/origin/${{ github.base_ref }} --name-only | grep CHANGELOG.md
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
## master
|
2
2
|
|
3
|
+
## 1.1.0
|
4
|
+
|
5
|
+
- Pipe logic is now implemented through a parser (https://github.com/schneems/rundoc/pull/22)
|
6
|
+
- Bugfix, background processes error when the log file is not touched before read, not sure why this is possible but here's a fix for it anyway (https://github.com/schneems/rundoc/commit/620ae55d8a5d3d443cf5e8cb77950a841f92900c)
|
7
|
+
|
3
8
|
## 1.0.1
|
4
9
|
|
5
10
|
- Allow non-headless browser sessions and navigation [#23](https://github.com/schneems/rundoc/pull/23)
|
data/Dockerfile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
FROM ruby:2.6.3-stretch
|
2
|
+
|
3
|
+
RUN useradd rundoc
|
4
|
+
RUN curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
|
5
|
+
|
6
|
+
RUN apt-get clean && apt-get update && apt-get install -y locales nodejs
|
7
|
+
|
8
|
+
RUN locale-gen en_US.UTF-8
|
9
|
+
ENV LC_ALL=C.UTF-8
|
10
|
+
ENV LANG=en_US.UTF-8
|
11
|
+
ENV LANGUAGE=en_US.UTF-8
|
12
|
+
ENV DISABLE_SPRING=1
|
13
|
+
|
14
|
+
WORKDIR /home/rundoc
|
15
|
+
RUN mkdir -p /home/rundoc/ && chown -R rundoc:rundoc /home/rundoc
|
16
|
+
USER rundoc
|
17
|
+
RUN mkdir -p /home/rundoc/workdir
|
18
|
+
|
19
|
+
RUN git config --global user.email "developer@example.com"
|
20
|
+
RUN git config --global user.name "Dev Eloper"
|
21
|
+
|
22
|
+
ADD Gemfile Gemfile.lock
|
23
|
+
|
24
|
+
RUN bundle install
|
@@ -6,12 +6,8 @@ module Rundoc
|
|
6
6
|
# ::: | tail -n 2
|
7
7
|
# => "test\ntmp.file\n"
|
8
8
|
def initialize(line)
|
9
|
-
|
10
|
-
@first = line_array.shift.strip
|
11
|
-
@delegate = Rundoc.code_command_from_keyword(@first, line_array.join(" "))
|
12
|
-
@delegate = Rundoc::CodeCommand::Bash.new(line) if @delegate.kind_of?(Rundoc::CodeCommand::NoSuchCommand)
|
9
|
+
@delegate = parse(line)
|
13
10
|
end
|
14
|
-
|
15
11
|
# before: "",
|
16
12
|
# after: "",
|
17
13
|
# commands:
|
@@ -27,6 +23,23 @@ module Rundoc
|
|
27
23
|
def to_md(env = {})
|
28
24
|
""
|
29
25
|
end
|
26
|
+
|
27
|
+
private def parse(code)
|
28
|
+
parser = Rundoc::PegParser.new.command
|
29
|
+
tree = parser.parse(code)
|
30
|
+
actual = Rundoc::PegTransformer.new.apply(tree)
|
31
|
+
|
32
|
+
if actual.is_a?(Array)
|
33
|
+
return actual.first
|
34
|
+
else
|
35
|
+
return actual
|
36
|
+
end
|
37
|
+
|
38
|
+
# Since `| tail -n 2` does not start with a `$` assume any "naked" commands
|
39
|
+
# are bash
|
40
|
+
rescue Parslet::ParseFailed
|
41
|
+
Rundoc::CodeCommand::Bash.new(code)
|
42
|
+
end
|
30
43
|
end
|
31
44
|
end
|
32
45
|
end
|
data/lib/rundoc/version.rb
CHANGED
data/rundoc.gemspec
CHANGED
@@ -18,7 +18,7 @@ end
|
|
18
18
|
Ruby on Rails is a popular web framework written in [Ruby](http://www.ruby-lang.org/). This guide covers using Rails 5 on Heroku. For information on running previous versions of Rails on Heroku, see the tutorial for [Rails 4.x](getting-started-with-rails4) or [Rails 3.x](getting-started-with-rails3).
|
19
19
|
|
20
20
|
```
|
21
|
-
:::-- $ ruby -e "exit 1 unless RUBY_VERSION == '2.6.
|
21
|
+
:::-- $ ruby -e "exit 1 unless RUBY_VERSION == '2.6.3'"
|
22
22
|
```
|
23
23
|
|
24
24
|
For this guide you will need:
|
@@ -68,6 +68,12 @@ Then move into your application directory.
|
|
68
68
|
:::>- $ cd myapp
|
69
69
|
```
|
70
70
|
|
71
|
+
Create a database locally:
|
72
|
+
|
73
|
+
```
|
74
|
+
:::>> $ bin/rake db:create
|
75
|
+
```
|
76
|
+
|
71
77
|
## Add the pg gem
|
72
78
|
|
73
79
|
If you're using an existing app that was created without specifying `--database=postgresql`, you need to add the `pg` gem to your Rails project. Edit your `Gemfile` and change this line:
|
@@ -158,7 +164,7 @@ Rails 5 requires Ruby 2.2.0 or above. Heroku has a recent version of Ruby instal
|
|
158
164
|
```ruby
|
159
165
|
:::-- $ sed -i'' -e '/^ruby/d' ./Gemfile
|
160
166
|
:::-> file.append Gemfile#4
|
161
|
-
ruby "2.6.
|
167
|
+
ruby "2.6.3"
|
162
168
|
```
|
163
169
|
|
164
170
|
You should also be running the same version of Ruby locally. You can check this by running `$ ruby -v`. You can get more information on [specifying your Ruby version on Heroku here](https://devcenter.heroku.com/articles/ruby-versions).
|
@@ -19,13 +19,13 @@ end
|
|
19
19
|
Ruby on Rails is a popular web framework written in [Ruby](http://www.ruby-lang.org/). This guide covers using Rails 6 on Heroku. For information on running previous versions of Rails on Heroku, see the tutorial for [Rails 5.x](getting-started-with-rails5) or [Rails 4.x](getting-started-with-rails4).
|
20
20
|
|
21
21
|
```
|
22
|
-
:::-- $ ruby -e "exit 1 unless RUBY_VERSION == '2.6.
|
22
|
+
:::-- $ ruby -e "exit 1 unless RUBY_VERSION == '2.6.5'"
|
23
23
|
```
|
24
24
|
|
25
25
|
For this guide you will need:
|
26
26
|
|
27
27
|
- Basic familiarity with Ruby/Rails and Git
|
28
|
-
- A locally installed version of Ruby 2.
|
28
|
+
- A locally installed version of Ruby 2.5.0+, Rubygems, Bundler, and Rails 6+
|
29
29
|
- A Heroku user account: [Signup is free and instant](https://signup.heroku.com/devcenter).
|
30
30
|
|
31
31
|
## Local setup
|
@@ -52,7 +52,7 @@ Press Enter at the prompt to upload your existing `ssh` key or create a new one,
|
|
52
52
|
To create a new app, first make sure that you're using Rails 6.x by running `rails -v`. If necessary, you can get the new version of rails by running the following:
|
53
53
|
|
54
54
|
```term
|
55
|
-
:::>> $ gem install rails --
|
55
|
+
:::>> $ gem install rails --no-document
|
56
56
|
```
|
57
57
|
|
58
58
|
Then create a new app and move into its root directory:
|
@@ -67,6 +67,12 @@ Then move into your application directory.
|
|
67
67
|
:::>- $ cd myapp
|
68
68
|
```
|
69
69
|
|
70
|
+
Create a database locally:
|
71
|
+
|
72
|
+
```
|
73
|
+
:::>> $ bin/rails db:create
|
74
|
+
```
|
75
|
+
|
70
76
|
## Add the pg gem
|
71
77
|
|
72
78
|
If you're using an existing app that was created without specifying `--database=postgresql`, you need to add the `pg` gem to your Rails project. Edit your `Gemfile` and change this line:
|
@@ -131,11 +137,11 @@ You can verify that the page is there by running your server:
|
|
131
137
|
:::-- background.stop(name: "server")
|
132
138
|
```
|
133
139
|
|
134
|
-
And visiting [http://localhost:3000](http://localhost:3000) in your browser. If you do not see the page, [use the logs](#view-
|
140
|
+
And visiting [http://localhost:3000](http://localhost:3000) in your browser. If you do not see the page, [use the logs](#view-logs) that are output to your server to debug.
|
135
141
|
|
136
142
|
## Heroku gems
|
137
143
|
|
138
|
-
Previous versions of Rails required you to add a gem to your project [rails_12factor](https://github.com/heroku/rails_12factor) to enable static asset serving and logging on Heroku. If you are deploying a new application, this gem is not needed. If you are upgrading an existing application, you can remove this gem provided you have the
|
144
|
+
Previous versions of Rails required you to add a gem to your project [rails_12factor](https://github.com/heroku/rails_12factor) to enable static asset serving and logging on Heroku. If you are deploying a new application, this gem is not needed. If you are upgrading an existing application, you can remove this gem provided you have the appropriate configuration in your `config/environments/production.rb` file:
|
139
145
|
|
140
146
|
|
141
147
|
```ruby
|
@@ -157,7 +163,7 @@ Rails 6 requires Ruby 2.2.0 or above. Heroku has a recent version of Ruby instal
|
|
157
163
|
```ruby
|
158
164
|
:::-- $ sed -i'' -e '/^ruby/d' ./Gemfile
|
159
165
|
:::-> file.append Gemfile#4
|
160
|
-
ruby "2.6.
|
166
|
+
ruby "2.6.5"
|
161
167
|
```
|
162
168
|
|
163
169
|
You should also be running the same version of Ruby locally. You can check this by running `$ ruby -v`. You can get more information on [specifying your Ruby version on Heroku here](https://devcenter.heroku.com/articles/ruby-versions).
|
@@ -211,7 +217,7 @@ You can verify that the remote was added to your project by running:
|
|
211
217
|
:::>> $ git config --list | grep heroku
|
212
218
|
```
|
213
219
|
|
214
|
-
If you see `fatal: not in a git directory` then you are likely not in the correct directory. Otherwise you can deploy your code. After you deploy your code, you
|
220
|
+
If you see `fatal: not in a git directory` then you are likely not in the correct directory. Otherwise, you can deploy your code. After you deploy your code, you need to migrate your database, make sure it is properly scaled, and use logs to debug any issues that come up.
|
215
221
|
|
216
222
|
Deploy your code:
|
217
223
|
|
@@ -351,6 +357,13 @@ You'll also want to add `.env` to your `.gitignore` since this is for local envi
|
|
351
357
|
:::>- $ git commit -m "add .env to .gitignore"
|
352
358
|
```
|
353
359
|
|
360
|
+
If you're running Rails 6.0.0 you'll need to create a `tmp/pids` directory:
|
361
|
+
|
362
|
+
```term
|
363
|
+
:::>> $ mkdir -p tmp/pids
|
364
|
+
:::>> $ touch tmp/pids/.gitkeep
|
365
|
+
```
|
366
|
+
|
354
367
|
Test your Procfile locally using Foreman. You can now start your web server by running:
|
355
368
|
|
356
369
|
```term
|
data/test/rundoc/parser_test.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rundoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Schneeman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: dotenv
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rake
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,9 +158,11 @@ executables:
|
|
144
158
|
extensions: []
|
145
159
|
extra_rdoc_files: []
|
146
160
|
files:
|
161
|
+
- ".github/workflows/check_changelog.yml"
|
147
162
|
- ".gitignore"
|
148
163
|
- ".travis.yml"
|
149
164
|
- CHANGELOG.md
|
165
|
+
- Dockerfile
|
150
166
|
- Gemfile
|
151
167
|
- README.md
|
152
168
|
- Rakefile
|
@@ -224,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
224
240
|
- !ruby/object:Gem::Version
|
225
241
|
version: '0'
|
226
242
|
requirements: []
|
227
|
-
rubygems_version: 3.
|
243
|
+
rubygems_version: 3.1.2
|
228
244
|
signing_key:
|
229
245
|
specification_version: 4
|
230
246
|
summary: RunDOC generates runable code from docs
|