Skip to content

Commit

Permalink
Rename gem to koine-filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
mjacobus committed Jul 10, 2020
1 parent 4c6729c commit e64ce36
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source 'https://rubygems.org'

# Specify your gem's dependencies in koine-file_system.gemspec
# Specify your gem's dependencies in koine-filesystem.gemspec
gemspec

gem 'coveralls', '~> 0.8.23'
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Koine::FileSystem
# Koine::Filesystem

This will [hopefully] be a file system abstraction as good as the [PHP League's Flysystem](https://github.com/thephpleague/flysystem).

Expand All @@ -11,7 +11,7 @@ This will [hopefully] be a file system abstraction as good as the [PHP League's
Add this line to your application's Gemfile:

```ruby
gem 'koine-file_system'
gem 'koine-filesystem'
```

And then execute:
Expand All @@ -20,7 +20,7 @@ And then execute:

Or install it yourself as:

$ gem install koine-file_system
$ gem install koine-filesystem

## Usage

Expand All @@ -43,4 +43,4 @@ The gem is available as open source under the terms of the [MIT License](https:/

## Code of Conduct

Everyone interacting in the Koine::FileSystem project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/mjacobus/koine-file_system/blob/master/CODE_OF_CONDUCT.md).
Everyone interacting in the Koine::Filesystem project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/mjacobus/koine-file_system/blob/master/CODE_OF_CONDUCT.md).
2 changes: 1 addition & 1 deletion bin/console
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby

require "bundler/setup"
require "koine/file_system"
require "koine/filesystem"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
Expand Down
6 changes: 3 additions & 3 deletions koine-file_system.gemspec → koine-filesystem.gemspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# frozen_string_literal: true

require_relative 'lib/koine/file_system/version'
require_relative 'lib/koine/filesystem/version'

Gem::Specification.new do |spec|
spec.name = 'koine-file_system'
spec.version = Koine::FileSystem::VERSION
spec.name = 'koine-filesystem'
spec.version = Koine::Filesystem::VERSION
spec.authors = ['Marcelo Jacobus']
spec.email = ['marcelo.jacobus@gmail.com']

Expand Down
14 changes: 0 additions & 14 deletions lib/koine/file_system.rb

This file was deleted.

14 changes: 14 additions & 0 deletions lib/koine/filesystem.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

require 'koine/filesystem/version'
require 'koine/filesystem/filesystem'
require 'koine/filesystem/path_sanitizer'
require 'koine/filesystem/adapters/base'
require 'koine/filesystem/adapters/local'

module Koine
module Filesystem
class Error < StandardError; end
class FileNotFound < Error; end
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module Koine
module FileSystem
module Filesystem
module Adapters
# rubocop:disable Lint/UnusedMethodArgument
class Base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'fileutils'

module Koine
module FileSystem
module Filesystem
module Adapters
# rubocop:disable Lint/UnusedMethodArgument
class Local < Base
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# frozen_string_literal: true

module Koine
module FileSystem
module Filesystem
# Inspired on
# https://flysystem.thephpleague.com/v1/docs/usage/filesystem-api/
class FileSystem
class Filesystem
def initialize(adapter)
@adapter = adapter
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'fileutils'

module Koine
module FileSystem
module Filesystem
class PathSanitizer
def sanitize(path)
path.to_s.gsub('/../', '/').gsub(%r{\.?\./}, '')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module Koine
module FileSystem
module Filesystem
VERSION = '0.1.0'
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper'

RSpec.describe Koine::FileSystem::Adapters::Base do
RSpec.describe Koine::Filesystem::Adapters::Base do
subject(:adapter) { described_class.new }

let(:path) { 'foo' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'spec_helper'
require 'digest'

RSpec.describe Koine::FileSystem::Adapters::Local do
RSpec.describe Koine::Filesystem::Adapters::Local do
let(:adapter) { described_class.new(root: FIXTURES_PATH) }

before do
Expand All @@ -15,7 +15,7 @@
expect do
adapter.read('unexisting')
end.to raise_error(
Koine::FileSystem::FileNotFound,
Koine::Filesystem::FileNotFound,
'File not found: unexisting'
)
end
Expand Down Expand Up @@ -186,7 +186,7 @@
map = result.map { |r| [r[:path], r[:timestamp].class.to_s] }.sort

expected = [
['folder1', 'Time'],
%w[folder1 Time],
['sample.png', 'Time'],
['sample.txt', 'Time']
].sort
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper'

RSpec.describe Koine::FileSystem::FileSystem do
RSpec.describe Koine::Filesystem::Filesystem do
subject(:fs) { described_class.new(adapter) }

let(:adapter) { instance_double(described_class) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper'

RSpec.describe Koine::FileSystem::PathSanitizer do
RSpec.describe Koine::Filesystem::PathSanitizer do
subject(:sanitizer) { described_class.new }

describe '#sanitize' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

require 'spec_helper'

RSpec.describe Koine::FileSystem do
RSpec.describe Koine::Filesystem do
it 'has a version number' do
expect(Koine::FileSystem::VERSION).not_to be nil
expect(Koine::Filesystem::VERSION).not_to be nil
end
end
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
end
end

require 'koine/file_system'
require 'koine/filesystem'
require 'rspec'

FIXTURES_PATH = File.expand_path('fixtures', __dir__)
Expand Down

0 comments on commit e64ce36

Please sign in to comment.