Skip to content

Commit

Permalink
Merge pull request #84 from sepulworld/zmw/adding_tests
Browse files Browse the repository at this point in the history
Zmw/adding tests
  • Loading branch information
sepulworld committed Apr 12, 2016
2 parents 0dd9160 + f8533fa commit 86798c3
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 164 deletions.
66 changes: 8 additions & 58 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2016-04-06 21:44:39 -0700 using RuboCop version 0.39.0.
# on 2016-04-09 19:20:20 -0700 using RuboCop version 0.38.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -40,7 +40,7 @@ Metrics/ClassLength:
Metrics/CyclomaticComplexity:
Max: 9

# Offense count: 123
# Offense count: 122
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# URISchemes: http, https
Metrics/LineLength:
Expand Down Expand Up @@ -129,27 +129,6 @@ Style/ClassVars:
Exclude:
- 'lib/aptly_publish.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly.
# SupportedStyles: assign_to_condition, assign_inside_condition
Style/ConditionalAssignment:
Exclude:
- 'lib/aptly_snapshot.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/DeprecatedHashMethods:
Exclude:
- 'lib/aptly_snapshot.rb'

# Offense count: 1
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'lib/aptly_snapshot.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/EmptyLines:
Expand All @@ -164,37 +143,22 @@ Style/EmptyLinesAroundBlockBody:
Exclude:
- 'test/test_aptly_repo.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: empty_lines, no_empty_lines
Style/EmptyLinesAroundClassBody:
Exclude:
- 'lib/aptly_snapshot.rb'

# Offense count: 3
# Cop supports --auto-correct.
Style/EmptyLinesAroundMethodBody:
Exclude:
- 'lib/aptly_snapshot.rb'

# Offense count: 62
# Offense count: 56
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues.
# SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets
Style/HashSyntax:
Enabled: false

# Offense count: 7
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: MaxLineLength.
Style/IfUnlessModifier:
Exclude:
- 'bin/aptly-cli'
- 'lib/aptly_publish.rb'
- 'lib/aptly_snapshot.rb'

# Offense count: 4
# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: normal, rails
Expand Down Expand Up @@ -262,21 +226,14 @@ Style/RedundantReturn:
- 'lib/aptly_publish.rb'
- 'lib/aptly_repo.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.
Style/SpaceAroundOperators:
Exclude:
- 'lib/aptly_snapshot.rb'

# Offense count: 10
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
# SupportedStyles: space, no_space
Style/SpaceInsideHashLiteralBraces:
Enabled: false

# Offense count: 50
# Offense count: 40
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Expand All @@ -292,13 +249,12 @@ Style/TrailingBlankLines:
- 'bin/aptly-cli'
- 'test/test_aptly_file.rb'

# Offense count: 35
# Offense count: 25
# Cop supports --auto-correct.
Style/TrailingWhitespace:
Exclude:
- 'bin/aptly-cli'
- 'lib/aptly_publish.rb'
- 'lib/aptly_snapshot.rb'
- 'test/test_aptly_cli_configure.rb'
- 'test/test_aptly_file.rb'
- 'test/test_aptly_misc.rb'
Expand All @@ -312,12 +268,6 @@ Style/TrivialAccessors:
Exclude:
- 'lib/aptly_load.rb'

# Offense count: 3
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Exclude:
- 'lib/aptly_snapshot.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/UnneededPercentQ:
Expand Down
2 changes: 1 addition & 1 deletion lib/aptly_cli/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module AptlyCli
VERSION = '0.2.7'.freeze
VERSION = '0.2.8'.freeze
end
12 changes: 6 additions & 6 deletions lib/aptly_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ class AptlyFile
attr_accessor :file_uri, :package, :local_file_path

# Load aptly-cli.conf and establish base_uri
config = AptlyCli::AptlyLoad.new.configure_with('/etc/aptly-cli.conf')
base_uri "http://#{config[:server]}:#{config[:port]}/api"
@config = AptlyCli::AptlyLoad.new.configure_with('/etc/aptly-cli.conf')
base_uri "http://#{@config[:server]}:#{@config[:port]}/api"

if config[:username]
if config[:password]
basic_auth config[:username].to_s, config[:password].to_s
if @config[:username]
if @config[:password]
basic_auth @config[:username].to_s, @config[:password].to_s
end
end

debug_output $stdout if config[:debug] == true
debug_output $stdout if @config[:debug] == true

def initialize(file_uri=nil, package=nil, local_file_path=nil)
end
Expand Down
12 changes: 6 additions & 6 deletions lib/aptly_misc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ class AptlyMisc
include HTTMultiParty

# Load aptly-cli.conf and establish base_uri
config = AptlyCli::AptlyLoad.new.configure_with('/etc/aptly-cli.conf')
base_uri "http://#{config[:server]}:#{config[:port]}/api"
@config = AptlyCli::AptlyLoad.new.configure_with('/etc/aptly-cli.conf')
base_uri "http://#{@config[:server]}:#{@config[:port]}/api"

if config[:username]
if config[:password]
basic_auth config[:username].to_s, config[:password].to_s
if @config[:username]
if @config[:password]
basic_auth @config[:username].to_s, @config[:password].to_s
end
end

debug_output $stdout if config[:debug] == true
debug_output $stdout if @config[:debug] == true

def get_graph(extension)
uri = "/graph.#{extension}"
Expand Down
12 changes: 6 additions & 6 deletions lib/aptly_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ class AptlyPackage
include HTTMultiParty

# Load aptly-cli.conf and establish base_uri
config = AptlyCli::AptlyLoad.new.configure_with('/etc/aptly-cli.conf')
base_uri "http://#{config[:server]}:#{config[:port]}/api"
@config = AptlyCli::AptlyLoad.new.configure_with('/etc/aptly-cli.conf')
base_uri "http://#{@config[:server]}:#{@config[:port]}/api"

if config[:username]
if config[:password]
basic_auth config[:username].to_s, config[:password].to_s
if @config[:username]
if @config[:password]
basic_auth @config[:username].to_s, @config[:password].to_s
end
end

debug_output $stdout if config[:debug] == true
debug_output $stdout if @config[:debug] == true

def package_show(package_key)
uri = "/packages/#{package_key}"
Expand Down
12 changes: 6 additions & 6 deletions lib/aptly_publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ class AptlyPublish
include HTTMultiParty

# Load aptly-cli.conf and establish base_uri
config = AptlyCli::AptlyLoad.new.configure_with('/etc/aptly-cli.conf')
base_uri "http://#{config[:server]}:#{config[:port]}/api"
@config = AptlyCli::AptlyLoad.new.configure_with('/etc/aptly-cli.conf')
base_uri "http://#{@config[:server]}:#{@config[:port]}/api"

if config[:username]
if config[:password]
basic_auth config[:username].to_s, config[:password].to_s
if @config[:username]
if @config[:password]
basic_auth @config[:username].to_s, @config[:password].to_s
end
end

debug_output $stdout if config[:debug] == true
debug_output $stdout if @config[:debug] == true

@@available_gpg_options = [:skip, :batch, :gpgKey, :keyring, :secretKeyring,
:passphrase, :passphraseFile]
Expand Down
12 changes: 6 additions & 6 deletions lib/aptly_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ module AptlyCli
class AptlyRepo
include HTTMultiParty
# Load aptly-cli.conf and establish base_uri
config = AptlyCli::AptlyLoad.new.configure_with('/etc/aptly-cli.conf')
base_uri "http://#{config[:server]}:#{config[:port]}/api"
@config = AptlyCli::AptlyLoad.new.configure_with('/etc/aptly-cli.conf')
base_uri "http://#{@config[:server]}:#{@config[:port]}/api"

if config[:username]
if config[:password]
basic_auth config[:username].to_s, config[:password].to_s
if @config[:username]
if @config[:password]
basic_auth @config[:username].to_s, @config[:password].to_s
end
end
debug_output $stdout if config[:debug] == true
debug_output $stdout if @config[:debug] == true

def repo_create(repo_options = { name: nil,
comment: nil,
Expand Down
Loading

0 comments on commit 86798c3

Please sign in to comment.