gitlab-to-doap 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b916d52f8ed0599d9977fdbcf7aad1f1be6bf980e9f92ea8736dd66a2941881
4
- data.tar.gz: b280683eb6ef78bf39d350d3942e8e8eed38af1df7c48dc4a186095fcc63fa7e
3
+ metadata.gz: 3d511ef2c2347429973b6b2adb6ff5a61aa600f589818914e0f36f917616733c
4
+ data.tar.gz: 953eb005fad056c2285ab0995f41e29bf64c2003bea2a7fc7af2451595e2f188
5
5
  SHA512:
6
- metadata.gz: bdf8256ba7f0342575984ae0bd7315d628fc7cbc92209aa6f269d7d78493644b9da484b63c6bb164292f15d6a9eddf8122bcb58778e09400bc6e8bbd87c5b8cb
7
- data.tar.gz: c9de9ed8391285c8eab9a6bbab95732f65673f8a72c6a498997c345a45cbfe921771f92403296c28bbaea99b15334e4535ce1aedb1dd0e62e129350299bc6ae0
6
+ metadata.gz: faa24d18862f9a5c9770377ab9b0f373c90f8b4224ebcb5fee960d7785c9906abde7b3269abb8295b203d5ff6d23ef5b5aebfccc0845f4dcf0353cf1a2a3398c
7
+ data.tar.gz: d2ce63059c54761066d1d0a23cc52ce09ea9b18f9e4e0c2b69607ba875b02edf9bf4b188f764e554d49457aef4b2196e1cc03c7cb904ad8a9aa88730e1f293ca
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  /man/man1/*.1
11
+ DESCRIPTION
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-to-doap (0.1.0)
4
+ gitlab-to-doap (0.1.1)
5
5
  builder (~> 3.0)
6
6
  gitlab (~> 4.0)
7
7
  redcarpet (~> 3.5)
data/README.md CHANGED
@@ -20,8 +20,8 @@ Pass the name of the project you want to produce a DOAP XML file for. It will be
20
20
 
21
21
  This requires two environment variables to be already defined:
22
22
 
23
- * **FOO**:
24
- * **FOO**:
23
+ * **GITLAB_API_ENDPOINT**: Full URL to the Gitlab instance. Must end with `/api/v4`.
24
+ * **GITLAB_API_PRIVATE_TOKEN**: Your personal access token to the Gitlab instance.
25
25
 
26
26
  ## Development
27
27
 
data/Rakefile CHANGED
@@ -20,4 +20,23 @@ file "man/man1/gitlab-to-doap.1" => ["man/man1/gitlab-to-doap.1.md"] do
20
20
  end
21
21
  end
22
22
 
23
+ CLOBBER << "DESCRIPTION"
24
+ file "DESCRIPTION" => ["README.md"] do
25
+ # Pull the lines between the first H1 and first H2 out of the readme as
26
+ # the project description
27
+ require_relative "lib/gitlab-to-doap"
28
+ readme_lines = File.readlines("README.md")
29
+ first = readme_lines.index(readme_lines.grep(/^# /)[0]) + 1
30
+ last = readme_lines.index(readme_lines.grep(/^## /)[0])
31
+ description_lines = readme_lines[first...last]
32
+ m = GitlabToDoap::Utilities.instance_method(:strip_markdown).bind(binding)
33
+ description = m.call(description_lines.join.strip)
34
+ description = description.split("\n").join(" ")
35
+
36
+ File.open("DESCRIPTION", "w") do |file|
37
+ file.puts description
38
+ end
39
+ end
40
+
23
41
  task build: "man/man1/gitlab-to-doap.1"
42
+ task build: "DESCRIPTION"
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "lib/gitlab-to-doap/version"
3
+ require_relative "lib/gitlab-to-doap"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "gitlab-to-doap"
@@ -8,8 +8,14 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["Nogweii"]
9
9
  spec.email = ["me@nogweii.net"]
10
10
 
11
- spec.summary = "Given a gitlab personal token and a gitlab project, produce a DOAP XML file."
12
- spec.description = File.read("README.md")
11
+ begin
12
+ description = File.read("DESCRIPTION")
13
+ rescue Errno::ENOENT
14
+ description = nil
15
+ end
16
+
17
+ spec.summary = description
18
+ spec.description = description
13
19
  spec.homepage = "https://code.aether.earth/nogweii/gitlab-to-doap"
14
20
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
15
21
 
@@ -21,7 +27,7 @@ Gem::Specification.new do |spec|
21
27
  # Specify which files should be added to the gem when it is released.
22
28
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
29
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features|man/.*\.md)/}) } + Dir.glob("man/**/*.?")
30
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features|man/.*\.md)/}) } + Dir.glob("man/**/*.?") + ["DESCRIPTION"]
25
31
  end
26
32
  spec.bindir = "exe"
27
33
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class GitlabToDoap
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-to-doap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nogweii
@@ -94,21 +94,11 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description: "# gitlab-to-doap\n\nGiven a [gitlab personal token][] and a gitlab project,
98
- produce a [DOAP][] XML\nfile.\n\n[gitlab personal token]: https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html\n[DOAP]:
99
- https://github.com/ewilderj/doap/wiki\n\n## Installation\n\nInstall it yourself
100
- as:\n\n $ gem install gitlab-to-doap\n\n## Usage\n\nPass the name of the project
101
- you want to produce a DOAP XML file for. It will be sent to `stdout`.\n\n $ gitlab-to-doap
102
- nogweii/dotfiles\n\nThis requires two environment variables to be already defined:\n\n*
103
- **FOO**: \n* **FOO**: \n\n## Development\n\nAfter checking out the repo, run `bin/setup`
104
- to install dependencies. Then, run `rake test` to run the tests. You can also run
105
- `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo
106
- install this gem onto your local machine, run `bundle exec rake install`. To release
107
- a new version, update the version number in `version.rb`, and then run `bundle exec
108
- rake release`, which will create a git tag for the version, push git commits and
109
- the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n##
110
- Contributing\n\nBug reports and pull requests are welcome! Email me or other contact
111
- methods at [my website](https://evaryont.me).\n"
97
+ description: 'Given a gitlab personal token (https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html)
98
+ and a gitlab project, produce a DOAP (https://github.com/ewilderj/doap/wiki) XML
99
+ file.
100
+
101
+ '
112
102
  email:
113
103
  - me@nogweii.net
114
104
  executables:
@@ -121,6 +111,7 @@ files:
121
111
  - ".solargraph.yml"
122
112
  - ".standard.yml"
123
113
  - CHANGELOG.md
114
+ - DESCRIPTION
124
115
  - Gemfile
125
116
  - Gemfile.lock
126
117
  - README.md
@@ -161,5 +152,7 @@ requirements: []
161
152
  rubygems_version: 3.1.4
162
153
  signing_key:
163
154
  specification_version: 4
164
- summary: Given a gitlab personal token and a gitlab project, produce a DOAP XML file.
155
+ summary: Given a gitlab personal token (https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html)
156
+ and a gitlab project, produce a DOAP (https://github.com/ewilderj/doap/wiki) XML
157
+ file.
165
158
  test_files: []