ossy 0.1.3 → 0.3.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6dfdf802909b30bd081ea1e537437d38b52ef117a769e0696bb6b024ab57c9e4
4
- data.tar.gz: a0aaf3afa2381cd6db31a72668ee57020e2ada102120e1c9f171c2757198c8bb
3
+ metadata.gz: 692163075005596e24fcd369ab7a65bae9cf32fbaa9fd4ba7443059b398d7744
4
+ data.tar.gz: aa9d30379da6adcace2c88605dd781e40395fb04eca3d483402f1214edcc8281
5
5
  SHA512:
6
- metadata.gz: 51a44d6e250c9e1482625dfec2ce42c16d73571f06c5bcb6508b682bb530fd33a6ef9657ba9757a05b7b6c9f073059d272e23bbb38e4f26ba3479e0c8f989fcb
7
- data.tar.gz: e687709b8d88ad167035c6259ae01604d0ece52ed54994cbd81fba0007186a389b6dd8ac023f8ae394c7e5951dc0ba24e9b021690cc2b70f4b5e749cd1093bbb
6
+ metadata.gz: ba6e94b22f3309d56f2df084ba0b27b4069d47aaa13b0789799d7b9b29b291dc64a974157ce90f74f0fbd2bbb9ae774acec296894ed0f885ce2dd0b810a2276c
7
+ data.tar.gz: 131df202b10b86c1d2d147ce73c44bb8a9bc6de334afde09bec4c13f9d342344b51964bea6357d00e2ec176fa4cb14e91f545f5e053270d4562b4366a19c02df
@@ -1,3 +1,15 @@
1
+ ## 0.2.0 2021-01-02
2
+
3
+ ### Added
4
+
5
+ - `configs merge` now supports merging array of hashes (@solnic)
6
+
7
+ ## 0.1.4 2020-01-23
8
+
9
+ ### Fixed
10
+
11
+ - `github workflow` no longer crashes after switching to `faraday` (@solnic)
12
+
1
13
  ## 0.1.3 2020-01-23
2
14
 
3
15
  ### Changed
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ossy/version'
3
+ require "ossy/version"
4
4
 
5
5
  module Ossy
6
6
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'dry/cli'
4
- require 'ossy/cli/commands'
3
+ require "dry/cli"
4
+ require "ossy/cli/commands"
5
5
 
6
6
  module Ossy
7
7
  module CLI
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ossy/cli/commands/core'
4
- require 'ossy/import'
5
- require 'ossy/release'
3
+ require "ossy/cli/commands/core"
4
+ require "ossy/import"
5
+ require "ossy/release"
6
6
 
7
- require 'yaml'
8
- require 'tilt'
9
- require 'ostruct'
7
+ require "yaml"
8
+ require "tilt"
9
+ require "ostruct"
10
10
 
11
11
  module Ossy
12
12
  module CLI
@@ -23,13 +23,13 @@ module Ossy
23
23
  end
24
24
  end
25
25
 
26
- desc 'Generates a changelog markdown file from a yaml config'
26
+ desc "Generates a changelog markdown file from a yaml config"
27
27
 
28
- argument :config_path, required: true, desc: 'The path to the changelog config'
29
- argument :output_path, required: true, desc: 'The path to the output md file'
30
- argument :template_path, required: true, desc: 'The path to the changelog ERB template'
28
+ argument :config_path, required: true, desc: "The path to the changelog config"
29
+ argument :output_path, required: true, desc: "The path to the output md file"
30
+ argument :template_path, required: true, desc: "The path to the changelog ERB template"
31
31
 
32
- option :data_path, required: false, desc: 'Optional path to additional data yaml file'
32
+ option :data_path, required: false, desc: "Optional path to additional data yaml file"
33
33
 
34
34
  def call(config_path:, output_path:, template_path:, data_path: nil)
35
35
  puts "Generating #{output_path} from #{config_path} using #{template_path}"
@@ -40,7 +40,7 @@ module Ossy
40
40
  context = Context.new(ctx_data)
41
41
 
42
42
  if data_path
43
- key = File.basename(data_path).gsub('.yml', '')
43
+ key = File.basename(data_path).gsub(".yml", "")
44
44
  data = YAML.load_file(data_path)
45
45
 
46
46
  context.update(key => OpenStruct.new(data))
@@ -1,19 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ossy/cli/commands/core'
4
- require 'ossy/import'
5
- require 'ossy/release'
3
+ require "ossy/cli/commands/core"
4
+ require "ossy/import"
5
+ require "ossy/release"
6
6
 
7
- require 'yaml'
7
+ require "yaml"
8
8
 
9
9
  module Ossy
10
10
  module CLI
11
11
  module Changelogs
12
12
  class Update < Commands::Core
13
- desc 'Adds a new entry to a changelog config'
13
+ desc "Adds a new entry to a changelog config"
14
14
 
15
- argument :config_path, required: true, desc: 'The path to the changelog config'
16
- argument :message, required: true, desc: 'Message text including the entry'
15
+ argument :config_path, required: true, desc: "The path to the changelog config"
16
+ argument :message, required: true, desc: "Message text including the entry"
17
17
 
18
18
  KEYS = %w[version summary date fixed added changed].freeze
19
19
 
@@ -21,8 +21,8 @@ module Ossy
21
21
  attrs = YAML.load(message)
22
22
  target = YAML.load_file(config_path)
23
23
 
24
- version = attrs['version'] || target[0]['version']
25
- entry = target.detect { |e| e['version'].eql?(version) } || {}
24
+ version = attrs["version"] || target[0]["version"]
25
+ entry = target.detect { |e| e["version"].eql?(version) } || {}
26
26
 
27
27
  release = Release.new(attrs.merge(version: version))
28
28
 
@@ -1,44 +1,50 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'dry/cli/registry'
3
+ require "dry/cli/registry"
4
4
 
5
5
  module Ossy
6
6
  module CLI
7
7
  module Commands
8
8
  extend Dry::CLI::Registry
9
9
 
10
- require 'ossy/cli/github/workflow'
11
- require 'ossy/cli/github/membership'
12
- require 'ossy/cli/github/tagger'
13
- require 'ossy/cli/github/member'
14
- require 'ossy/cli/github/update_file'
10
+ require "ossy/cli/github/workflow"
11
+ require "ossy/cli/github/membership"
12
+ require "ossy/cli/github/tagger"
13
+ require "ossy/cli/github/member"
14
+ require "ossy/cli/github/update_file"
15
15
 
16
- require 'ossy/cli/changelogs/generate'
17
- require 'ossy/cli/changelogs/update'
16
+ require "ossy/cli/changelogs/generate"
17
+ require "ossy/cli/changelogs/update"
18
18
 
19
- require 'ossy/cli/configs/merge'
19
+ require "ossy/cli/releases/generate"
20
20
 
21
- require 'ossy/cli/templates/compile'
21
+ require "ossy/cli/configs/merge"
22
22
 
23
- register 'github', aliases: %w[gh] do |github|
24
- github.register 'workflow', Github::Workflow, aliases: %w[w]
25
- github.register 'membership', Github::Membership, aliases: %w[m]
26
- github.register 'tagger', Github::Tagger, aliases: %w[t]
27
- github.register 'member', Github::Member, aliases: %w[om]
28
- github.register 'update_file', Github::UpdateFile, aliases: %w[uf]
23
+ require "ossy/cli/templates/compile"
24
+
25
+ register "github", aliases: %w[gh] do |github|
26
+ github.register "workflow", Github::Workflow, aliases: %w[w]
27
+ github.register "membership", Github::Membership, aliases: %w[m]
28
+ github.register "tagger", Github::Tagger, aliases: %w[t]
29
+ github.register "member", Github::Member, aliases: %w[om]
30
+ github.register "update_file", Github::UpdateFile, aliases: %w[uf]
31
+ end
32
+
33
+ register "templates", aliases: %w[t] do |templates|
34
+ templates.register "compile", Templates::Compile, aliases: %w[c]
29
35
  end
30
36
 
31
- register 'templates', aliases: %w[t] do |templates|
32
- templates.register 'compile', Templates::Compile, aliases: %w[c]
37
+ register "changelogs", aliases: %w[ch] do |changelogs|
38
+ changelogs.register "generate", Changelogs::Generate, aliases: %w[g]
39
+ changelogs.register "update", Changelogs::Update, aliases: %w[u]
33
40
  end
34
41
 
35
- register 'changelogs', aliases: %w[ch] do |changelogs|
36
- changelogs.register 'generate', Changelogs::Generate, aliases: %w[g]
37
- changelogs.register 'update', Changelogs::Update, aliases: %w[u]
42
+ register "releases", aliases: %w[r] do |releases|
43
+ releases.register "generate", Releases::Generate, aliases: %w[g]
38
44
  end
39
45
 
40
- register 'configs', aliases: %w[c] do |configs|
41
- configs.register 'merge', Configs::Merge, aliases: %w[m]
46
+ register "configs", aliases: %w[c] do |configs|
47
+ configs.register "merge", Configs::Merge, aliases: %w[m]
42
48
  end
43
49
  end
44
50
  end
@@ -1,39 +1,61 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ossy/cli/commands/core'
4
- require 'ossy/import'
3
+ require "ossy/cli/commands/core"
4
+ require "ossy/import"
5
5
 
6
- require 'yaml'
6
+ require "yaml"
7
7
 
8
8
  module Ossy
9
9
  module CLI
10
10
  module Configs
11
11
  class Merge < Commands::Core
12
- desc 'Merge two yaml config files into a new one'
12
+ desc "Merge two yaml config files into a new one"
13
13
 
14
- argument :source_path, required: true, desc: 'The path to the source file'
15
- argument :target_path, required: true, desc: 'The path to the target file'
16
- argument :output_path, required: true, desc: 'The path to the output file'
14
+ argument :source_path, required: true, desc: "The path to the source file"
15
+ argument :target_path, required: true, desc: "The path to the target file"
16
+ argument :output_path, required: true, desc: "The path to the output file"
17
17
 
18
- def call(source_path:, target_path:, output_path:)
18
+ option :identifiers, required: false, default: "",
19
+ desc: "Key identifier that should be used for merging arrays of hashes"
20
+
21
+ def call(source_path:, target_path:, output_path:, **opts)
19
22
  puts "Merging #{source_path} + #{target_path} into #{output_path}"
20
23
 
24
+ identifiers = opts[:identifiers].split(",").map { |s| s.split(":") }.to_h
25
+
21
26
  source = YAML.load_file(source_path)
22
27
  target = YAML.load_file(target_path)
23
28
 
24
- output = deep_merge(source, target)
29
+ output = deep_merge(source, target, identifiers)
25
30
 
26
31
  File.write(output_path, YAML.dump(output))
27
32
  end
28
33
 
29
34
  private
30
35
 
31
- def deep_merge(h1, h2, &block)
36
+ def deep_merge(h1, h2, identifiers, &block)
32
37
  h1.merge(h2) do |key, val1, val2|
33
38
  if val1.is_a?(Hash) && val2.is_a?(Hash)
34
- deep_merge(val1, val2, &block)
39
+ deep_merge(val1, val2, identifiers, &block)
35
40
  elsif val1.is_a?(Array) && val2.is_a?(Array)
36
- (val1 + val2).uniq
41
+ if (id = identifiers[key])
42
+ arr = (val1 + val2)
43
+ .group_by { |el| el.fetch(id) }
44
+ .values
45
+ .map { |arr| arr.size.equal?(2) ? deep_merge(*arr, identifiers) : arr }
46
+ .flatten(1)
47
+ .uniq
48
+
49
+ arr
50
+ .map
51
+ .with_index { |el, idx|
52
+ (after = el.delete("_after")) ?
53
+ [el, arr.index(arr.detect { |a| a[id].eql?(after) }) + 1] :
54
+ [el, idx]
55
+ }.sort_by(&:last).map(&:first)
56
+ else
57
+ (val1 + val2).uniq
58
+ end
37
59
  else
38
60
  val2
39
61
  end
@@ -1,24 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ossy/cli/commands/core'
4
- require 'ossy/import'
3
+ require "ossy/cli/commands/core"
4
+ require "ossy/import"
5
5
 
6
6
  module Ossy
7
7
  module CLI
8
8
  module Github
9
9
  class Member < Commands::Core
10
- include Import['github.client']
10
+ include Import["github.client"]
11
11
 
12
- desc 'Return org member identified by the full name'
12
+ desc "Return org member identified by the full name"
13
13
 
14
- argument :name, required: true, desc: 'The member name'
15
- argument :org, required: true, desc: 'The org name'
14
+ argument :name, required: true, desc: "The member name"
15
+ argument :org, required: true, desc: "The org name"
16
16
 
17
17
  def call(name:, org:)
18
18
  result = client.member(name, org: org)
19
19
 
20
20
  if result
21
- puts result['login']
21
+ puts result["login"]
22
22
  end
23
23
  end
24
24
  end
@@ -1,26 +1,26 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ossy/cli/commands/core'
4
- require 'ossy/import'
3
+ require "ossy/cli/commands/core"
4
+ require "ossy/import"
5
5
 
6
6
  module Ossy
7
7
  module CLI
8
8
  module Github
9
9
  class Membership < Commands::Core
10
- include Import['github.client']
10
+ include Import["github.client"]
11
11
 
12
- desc 'Check if a given user has an active membership in a team'
12
+ desc "Check if a given user has an active membership in a team"
13
13
 
14
- argument :username, required: true, desc: 'The username'
15
- argument :org, required: true, desc: 'The name of the org'
16
- argument :team, required: true, desc: 'The name of the team'
14
+ argument :username, required: true, desc: "The username"
15
+ argument :org, required: true, desc: "The name of the org"
16
+ argument :team, required: true, desc: "The name of the team"
17
17
 
18
18
  option :verify, required: false
19
19
 
20
- def call(username:, org:, team:, verify: 'false')
20
+ def call(username:, org:, team:, verify: "false")
21
21
  result = client.membership?(username, org: org, team: team)
22
22
 
23
- if verify.eql?('true')
23
+ if verify.eql?("true")
24
24
  exit(1) unless result
25
25
  else
26
26
  puts "#{username} has active membership in #{org}/@#{team}"
@@ -1,24 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ossy/cli/commands/core'
4
- require 'ossy/import'
3
+ require "ossy/cli/commands/core"
4
+ require "ossy/import"
5
5
 
6
6
  module Ossy
7
7
  module CLI
8
8
  module Github
9
9
  class Tagger < Commands::Core
10
- include Import['github.client']
10
+ include Import["github.client"]
11
11
 
12
- desc 'Return tagger email for a verified tag'
12
+ desc "Return tagger email for a verified tag"
13
13
 
14
- argument :repo, required: true, desc: 'The repo'
15
- argument :tag, required: true, desc: 'The tag name'
14
+ argument :repo, required: true, desc: "The repo"
15
+ argument :tag, required: true, desc: "The tag name"
16
16
 
17
17
  def call(repo:, tag:)
18
18
  result = client.tagger(repo: repo, tag: tag)
19
19
 
20
20
  if result && result[:verified].equal?(true)
21
- puts result[:tagger]['name']
21
+ puts result[:tagger]["name"]
22
22
  end
23
23
  end
24
24
  end
@@ -1,17 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ossy/cli/commands/core'
4
- require 'open-uri'
3
+ require "ossy/cli/commands/core"
4
+ require "open-uri"
5
5
 
6
6
  module Ossy
7
7
  module CLI
8
8
  module Github
9
9
  class UpdateFile < Commands::Core
10
- desc 'Update provided file using a canonical source in another repository'
10
+ desc "Update provided file using a canonical source in another repository"
11
11
 
12
- argument(:repo, required: true, desc: 'Source repository')
13
- argument(:file, required: true, desc: 'File path ie owner/repo:path/to/file')
14
- option(:branch, required: false, desc: 'Branch name', default: 'master')
12
+ argument(:repo, required: true, desc: "Source repository")
13
+ argument(:file, required: true, desc: "File path ie owner/repo:path/to/file")
14
+ option(:branch, required: false, desc: "Branch name", default: "master")
15
15
 
16
16
  def call(repo:, file:, branch:)
17
17
  url = "https://raw.githubusercontent.com/#{repo}/#{branch}/shared/#{file}"
@@ -1,30 +1,30 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'json'
3
+ require "json"
4
4
 
5
- require 'ossy/cli/commands/core'
6
- require 'ossy/import'
5
+ require "ossy/cli/commands/core"
6
+ require "ossy/import"
7
7
 
8
8
  module Ossy
9
9
  module CLI
10
10
  module Github
11
11
  class Workflow < Commands::Core
12
- include Import['github.workflow']
12
+ include Import["github.workflow"]
13
13
 
14
- desc 'Start a GitHub workflow'
14
+ desc "Start a GitHub workflow"
15
15
 
16
- argument :repo, required: true, desc: 'The name of the repository on GitHub'
17
- argument :name, required: true, desc: 'The name of the workflow'
16
+ argument :repo, required: true, desc: "The name of the repository on GitHub"
17
+ argument :name, required: true, desc: "The name of the workflow"
18
18
 
19
- option :payload, required: false, desc: 'Optional client payload'
19
+ option :payload, required: false, desc: "Optional client payload"
20
20
 
21
21
  def call(repo:, name:, payload: "{}")
22
22
  puts "Requesting: #{repo} => #{name}"
23
23
 
24
24
  result = workflow.(repo, name, JSON.load(payload))
25
25
 
26
- if result.code.eql?(204)
27
- puts 'Success!'
26
+ if result.status.eql?(204)
27
+ puts "Success!"
28
28
  else
29
29
  puts "Failure! #{result.inspect}"
30
30
  end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ossy/cli/commands/core"
4
+ require "ossy/import"
5
+ require "ossy/release"
6
+
7
+ require "yaml"
8
+ require "tilt"
9
+ require "ostruct"
10
+
11
+ module Ossy
12
+ module CLI
13
+ module Releases
14
+ class Context < OpenStruct
15
+ def self.new(data)
16
+ super(releases: data.map(&Release))
17
+ end
18
+
19
+ def latest_release
20
+ releases.first
21
+ end
22
+
23
+ def previous_release
24
+ releases[1]
25
+ end
26
+
27
+ def update(hash)
28
+ hash.each { |k, v| self[k.to_sym] = v }
29
+ self
30
+ end
31
+ end
32
+
33
+ class Generate < Commands::Core
34
+ desc "Generates a release markdown file from a changelog.yml file"
35
+
36
+ argument :config_path, required: true, desc: "The path to the changelog config"
37
+ argument :output_path, required: true, desc: "The path to the output md file"
38
+ argument :template_path, required: true, desc: "The path to the changelog ERB template"
39
+
40
+ option :data_path, required: false, desc: "Optional path to additional data yaml file"
41
+
42
+ def call(config_path:, output_path:, template_path:, data_path: nil)
43
+ puts "Generating #{output_path} from #{config_path} using #{template_path}"
44
+
45
+ ctx_data = YAML.load_file(config_path)
46
+ template = Tilt.new(template_path)
47
+
48
+ context = Context.new(ctx_data)
49
+
50
+ if data_path
51
+ key = File.basename(data_path).gsub(".yml", "")
52
+ data = YAML.load_file(data_path)
53
+
54
+ context.update(key => OpenStruct.new(data))
55
+ end
56
+
57
+ output = template.render(context)
58
+
59
+ File.write(output_path, "#{output.strip}\n")
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'dry/inflector'
4
- require 'ossy/cli/commands/core'
5
- require 'ossy/import'
3
+ require "dry/inflector"
4
+ require "ossy/cli/commands/core"
5
+ require "ossy/import"
6
6
 
7
- require 'tilt'
8
- require 'erb'
9
- require 'yaml'
10
- require 'ostruct'
7
+ require "tilt"
8
+ require "erb"
9
+ require "yaml"
10
+ require "ostruct"
11
11
 
12
12
  module Ossy
13
13
  module CLI
@@ -15,7 +15,7 @@ module Ossy
15
15
  class Compile < Commands::Core
16
16
  class Context < OpenStruct
17
17
  Inflector = Dry::Inflector.new do |i|
18
- i.acronym 'CLI'
18
+ i.acronym "CLI"
19
19
  end
20
20
 
21
21
  def inflector
@@ -23,13 +23,13 @@ module Ossy
23
23
  end
24
24
  end
25
25
 
26
- include Import['github.workflow']
26
+ include Import["github.workflow"]
27
27
 
28
- desc 'Compile an erb template'
28
+ desc "Compile an erb template"
29
29
 
30
- argument :source_path, required: true, desc: 'The path to the template file'
31
- argument :target_path, required: true, desc: 'The path to the output file'
32
- argument :data_file, required: true, desc: 'The path to yaml data file'
30
+ argument :source_path, required: true, desc: "The path to the template file"
31
+ argument :target_path, required: true, desc: "The path to the output file"
32
+ argument :data_file, required: true, desc: "The path to yaml data file"
33
33
 
34
34
  def call(source_path:, target_path:, data_file:)
35
35
  puts "Compiling #{source_path} => #{target_path}"
@@ -1,21 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'dry/system/container'
4
- require 'dry/system/components'
3
+ require "dry/system/container"
4
+ require "dry/system/components"
5
5
 
6
- require 'ossy/types'
6
+ require "ossy/types"
7
7
 
8
8
  module Ossy
9
9
  class Container < Dry::System::Container
10
- use :env, inferrer: proc { ENV.fetch('OSSY_ENV') { 'development' }.to_sym }
10
+ use :env, inferrer: proc { ENV.fetch("OSSY_ENV") { "development" }.to_sym }
11
11
 
12
12
  configure do |config|
13
- config.root = Pathname(__dir__).join('../../')
13
+ config.root = Pathname(__dir__).join("../../")
14
14
  config.name = :ossy
15
- config.default_namespace = 'ossy'
15
+ config.default_namespace = "ossy"
16
16
  end
17
17
 
18
- load_paths! 'lib'
18
+ load_paths! "lib"
19
19
 
20
20
  boot(:settings, from: :system) do
21
21
  settings do
@@ -1,16 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ossy/import'
3
+ require "ossy/import"
4
4
 
5
- require 'faraday'
6
- require 'json'
5
+ require "faraday"
6
+ require "json"
7
7
 
8
8
  module Ossy
9
9
  module Github
10
10
  class Client
11
11
  include Import[:settings]
12
12
 
13
- BASE_URL = 'https://api.github.com'
13
+ BASE_URL = "https://api.github.com"
14
14
 
15
15
  def membership?(username, org:, team:)
16
16
  path = "orgs/#{org}/teams/#{team}/memberships/#{username}"
@@ -20,7 +20,7 @@ module Ossy
20
20
 
21
21
  json = JSON.parse(resp.body)
22
22
 
23
- json['state'].eql?('active')
23
+ json["state"].eql?("active")
24
24
  end
25
25
 
26
26
  def tagger(repo:, tag:)
@@ -29,7 +29,7 @@ module Ossy
29
29
 
30
30
  return false unless resp.status.equal?(200)
31
31
 
32
- sha = JSON.parse(resp.body)['object']['sha']
32
+ sha = JSON.parse(resp.body)["object"]["sha"]
33
33
 
34
34
  path = "repos/#{repo}/git/tags/#{sha}"
35
35
  resp = get(path)
@@ -38,7 +38,7 @@ module Ossy
38
38
 
39
39
  json = JSON.parse(resp.body)
40
40
 
41
- { tagger: json['tagger'], verified: json['verification']['verified'] }
41
+ { tagger: json["tagger"], verified: json["verification"]["verified"] }
42
42
  end
43
43
 
44
44
  def member(name, org:)
@@ -47,11 +47,9 @@ module Ossy
47
47
 
48
48
  return nil unless resp.status.equal?(200)
49
49
 
50
- user = JSON.parse(resp.body)
51
- .map { |member| user(member['login']) }
52
- .detect { |user| user['name'].eql?(name) }
53
-
54
- user
50
+ JSON.parse(resp.body)
51
+ .map { |member| user(member["login"]) }
52
+ .detect { |user| user["name"].eql?(name) }
55
53
  end
56
54
 
57
55
  def user(login)
@@ -82,8 +80,8 @@ module Ossy
82
80
  end
83
81
 
84
82
  def headers
85
- { 'Content-Type' => 'application/json',
86
- 'Accept' => 'application/vnd.github.everest-preview+json' }
83
+ { "Content-Type" => "application/json",
84
+ "Accept" => "application/vnd.github.everest-preview+json" }
87
85
  end
88
86
  end
89
87
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ossy/github/client'
3
+ require "ossy/github/client"
4
4
 
5
5
  module Ossy
6
6
  module Github
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ossy/container'
3
+ require "ossy/container"
4
4
 
5
5
  module Ossy
6
6
  Import = Container.injector
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ossy/types'
4
- require 'ossy/struct'
3
+ require "ossy/types"
4
+ require "ossy/struct"
5
5
 
6
6
  module Ossy
7
7
  class Release < Ossy::Struct
@@ -12,7 +12,7 @@ module Ossy
12
12
  attribute? :added, Types::ChangeList
13
13
  attribute? :changed, Types::ChangeList
14
14
 
15
- def each(&block)
15
+ def each
16
16
  %i[fixed added changed].each do |type|
17
17
  yield(type, self[type]) unless self[type].empty?
18
18
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'dry/struct'
3
+ require "dry/struct"
4
4
 
5
5
  module Ossy
6
6
  class Struct < Dry::Struct
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'dry/types'
3
+ require "dry/types"
4
4
 
5
5
  module Ossy
6
6
  module Types
7
7
  include Dry.Types()
8
8
 
9
- Version = Types::String.constrained(eql: 'unreleased') |
10
- Types::String.constrained(format: %r[\d+\.\d+\.\d+])
9
+ Version = Types::String.constrained(eql: "unreleased") |
10
+ Types::String.constrained(format: /\d+\.\d+\.\d+/)
11
11
 
12
12
  Summary = Types::String.constrained(filled: true).optional
13
13
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ossy
4
- VERSION = '0.1.3'
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ossy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-23 00:00:00.000000000 Z
11
+ date: 2021-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: dry-inflector
14
+ name: dry-cli
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.1'
19
+ version: '0.5'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.1.2
22
+ version: 0.5.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '0.1'
29
+ version: '0.5'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.1.2
32
+ version: 0.5.1
33
33
  - !ruby/object:Gem::Dependency
34
- name: dry-cli
34
+ name: dry-inflector
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.5'
39
+ version: '0.1'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 0.5.1
42
+ version: 0.1.2
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '0.5'
49
+ version: '0.1'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 0.5.1
52
+ version: 0.1.2
53
53
  - !ruby/object:Gem::Dependency
54
- name: dry-types
54
+ name: dry-struct
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
@@ -65,33 +65,33 @@ dependencies:
65
65
  - !ruby/object:Gem::Version
66
66
  version: '1.2'
67
67
  - !ruby/object:Gem::Dependency
68
- name: dry-struct
68
+ name: dry-system
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: '1.2'
73
+ version: '0.14'
74
74
  type: :runtime
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: '1.2'
80
+ version: '0.14'
81
81
  - !ruby/object:Gem::Dependency
82
- name: dry-system
82
+ name: dry-types
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '0.14'
87
+ version: '1.2'
88
88
  type: :runtime
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: '0.14'
94
+ version: '1.2'
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: faraday
97
97
  requirement: !ruby/object:Gem::Requirement
@@ -166,16 +166,16 @@ dependencies:
166
166
  name: rubocop
167
167
  requirement: !ruby/object:Gem::Requirement
168
168
  requirements:
169
- - - '='
169
+ - - "~>"
170
170
  - !ruby/object:Gem::Version
171
- version: 0.71.0
171
+ version: '1.6'
172
172
  type: :development
173
173
  prerelease: false
174
174
  version_requirements: !ruby/object:Gem::Requirement
175
175
  requirements:
176
- - - '='
176
+ - - "~>"
177
177
  - !ruby/object:Gem::Version
178
- version: 0.71.0
178
+ version: '1.6'
179
179
  description: Ossy is your ruby gem maintenance helper
180
180
  email:
181
181
  - piotr.solnica@gmail.com
@@ -199,6 +199,7 @@ files:
199
199
  - lib/ossy/cli/github/tagger.rb
200
200
  - lib/ossy/cli/github/update_file.rb
201
201
  - lib/ossy/cli/github/workflow.rb
202
+ - lib/ossy/cli/releases/generate.rb
202
203
  - lib/ossy/cli/templates/compile.rb
203
204
  - lib/ossy/container.rb
204
205
  - lib/ossy/github/client.rb
@@ -216,7 +217,7 @@ metadata:
216
217
  homepage_uri: https://github.com/solnic/ossy
217
218
  source_code_uri: https://github.com/solnic/ossy
218
219
  changelog_uri: https://github.com/solnic/ossy
219
- post_install_message:
220
+ post_install_message:
220
221
  rdoc_options: []
221
222
  require_paths:
222
223
  - lib
@@ -231,8 +232,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
232
  - !ruby/object:Gem::Version
232
233
  version: '0'
233
234
  requirements: []
234
- rubygems_version: 3.0.3
235
- signing_key:
235
+ rubygems_version: 3.2.3
236
+ signing_key:
236
237
  specification_version: 4
237
238
  summary: Ossy is your ruby gem maintenance helper
238
239
  test_files: []