Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add freeze and frozen_string_literal magick comment #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/yandex/disk.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# coding: utf-8

# frozen_string_literal: true

require 'yandex/disk/version'

module Yandex
Expand All @@ -10,4 +12,4 @@ module Backup
autoload :Storage, 'yandex/disk/backup/storage'
end
end
end
end
7 changes: 5 additions & 2 deletions lib/yandex/disk/backup/storage.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# coding: utf-8

# frozen_string_literal: true

require 'yandex/disk/client'

module Backup
Expand Down Expand Up @@ -36,10 +39,10 @@ def remove!(package)
end

def storage_name
'Yandex::Disk'
'Yandex::Disk'.freeze
end

end
end
end
end
end
2 changes: 2 additions & 0 deletions lib/yandex/disk/client.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# coding: utf-8

# frozen_string_literal: true

require 'base64'
require 'faraday'
require 'faraday_middleware'
Expand Down
2 changes: 2 additions & 0 deletions lib/yandex/disk/client/request.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Yandex::Disk::Client::Request
autoload :Space, 'yandex/disk/client/request/space'
autoload :List, 'yandex/disk/client/request/list'
Expand Down
7 changes: 5 additions & 2 deletions lib/yandex/disk/client/request/list.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# frozen_string_literal: true

require 'nokogiri'

class Yandex::Disk::Client::Request::List
HEADERS = {
:Depth => 1
}
}.freeze

def initialize http, path
@http = http
@path = path
freeze
end

def perform
Expand Down Expand Up @@ -86,4 +89,4 @@ def parse body

list_parser
end
end
end
7 changes: 5 additions & 2 deletions lib/yandex/disk/client/request/private.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class Yandex::Disk::Client::Request::Private
BODY =
'<propertyupdate xmlns="DAV:">
Expand All @@ -6,13 +8,14 @@ class Yandex::Disk::Client::Request::Private
<public_url xmlns="urn:yandex:disk:meta" />
</prop>
</set>
</propertyupdate>'
</propertyupdate>'.freeze
HEADERS = {
}
}.freeze

def initialize http, path
@http = http
@path = path
freeze
end

def perform
Expand Down
9 changes: 6 additions & 3 deletions lib/yandex/disk/client/request/publication.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
# frozen_string_literal: true

require 'nokogiri'

class Yandex::Disk::Client::Request::Publication
BODY =
BODY =
'<propertyupdate xmlns="DAV:">
<set>
<prop>
<public_url xmlns="urn:yandex:disk:meta">true</public_url>
</prop>
</set>
</propertyupdate>'
</propertyupdate>'.freeze
HEADERS = {
}
}.freeze

def initialize http, path
@http = http
@path = path
freeze
end

def perform
Expand Down
9 changes: 6 additions & 3 deletions lib/yandex/disk/client/request/space.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'nokogiri'

class Yandex::Disk::Client::Request::Space
Expand All @@ -6,13 +8,14 @@ class Yandex::Disk::Client::Request::Space
<D:quota-available-bytes/>
<D:quota-used-bytes/>
</D:prop>
</D:propfind>'
</D:propfind>'.freeze
HEADERS = {
:Depth => 0
}
}.freeze

def initialize http
@http = http
freeze
end

def perform
Expand Down Expand Up @@ -53,4 +56,4 @@ def parse body

attributes_parser
end
end
end
4 changes: 3 additions & 1 deletion lib/yandex/disk/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# coding: utf-8

# frozen_string_literal: true

module Yandex
module Disk
VERSION = '0.0.8'
VERSION = '0.0.8'.freeze
end
end
4 changes: 3 additions & 1 deletion test/yandex_dist_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "minitest/autorun"
require File.expand_path(File.dirname(__FILE__) + '/../lib/yandex/disk')

Expand Down Expand Up @@ -62,4 +64,4 @@ def test_put_in_nested_folder
assert [email protected]('README.md', '/new_folder/README.md')
end

end
end