daviddo 0.1.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1aa01e4fcedb0a20f2eb234a8e906ebf2c92e6717e9012099d451fa5f1fee8bd
4
+ data.tar.gz: 3f290ed2f469b2a7d2115ee7ec8bd59c640395e220ffb0606eee62d5c715bc7e
5
+ SHA512:
6
+ metadata.gz: f9bb23a199b15ac06f9bfb58877b0744813076d015cab8921eae9fe7c0033e7975e88cabbd7a043e1ebd572976e17a5fe0cfaa399048e28a136b2fde6db2f494
7
+ data.tar.gz: 26e4b46d2651568f2b963f4d574648db23f390f299038febdd25c2bc027e87142e16b3287dc13151b4c057737078d7d152d76ca89f2008ddd95c12cf2cd70c59
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in david.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,36 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ daviddo (0.1.1)
5
+ engtagger
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ diff-lcs (1.4.4)
11
+ engtagger (0.2.2)
12
+ rake (13.0.6)
13
+ rspec (3.10.0)
14
+ rspec-core (~> 3.10.0)
15
+ rspec-expectations (~> 3.10.0)
16
+ rspec-mocks (~> 3.10.0)
17
+ rspec-core (3.10.1)
18
+ rspec-support (~> 3.10.0)
19
+ rspec-expectations (3.10.1)
20
+ diff-lcs (>= 1.2.0, < 2.0)
21
+ rspec-support (~> 3.10.0)
22
+ rspec-mocks (3.10.2)
23
+ diff-lcs (>= 1.2.0, < 2.0)
24
+ rspec-support (~> 3.10.0)
25
+ rspec-support (3.10.2)
26
+
27
+ PLATFORMS
28
+ x86_64-darwin-20
29
+
30
+ DEPENDENCIES
31
+ daviddo!
32
+ rake (~> 13.0)
33
+ rspec
34
+
35
+ BUNDLED WITH
36
+ 2.3.11
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # David
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/david`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Install the gem and add to the application's Gemfile by executing:
10
+
11
+ $ bundle add david
12
+
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
14
+
15
+ $ gem install david
16
+
17
+ ## Usage
18
+
19
+ TODO: Write usage instructions here
20
+
21
+ ## Development
22
+
23
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24
+
25
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
26
+
27
+ ## Contributing
28
+
29
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/david.
data/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ task default: %i[]
5
+ Dir.glob('tasks/**/*.rake').each(&method(:import))
data/david.gemspec ADDED
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/david/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "daviddo"
7
+ spec.version = David::VERSION
8
+ spec.authors = ["David"]
9
+ spec.email = ["truong.dohuy0501@gmail.com"]
10
+
11
+ spec.summary = %q{English to doge translations}
12
+ spec.description = %q{Convert everyday boring English into doge speak!}
13
+ spec.homepage = "https://github.com/truongdohuy0501/david"
14
+ spec.required_ruby_version = ">= 2.6.0"
15
+ spec.license = "MIT"
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(__dir__) do
23
+ `git ls-files -z`.split("\x0").reject do |f|
24
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
25
+ end
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ # Uncomment to register a new dependency of your gem
32
+ # spec.add_dependency "example-gem", "~> 1.0"
33
+
34
+ # For more information and examples about making a new gem, check out our
35
+ # guide at: https://bundler.io/guides/creating_gem.html
36
+
37
+ spec.add_development_dependency 'rspec'
38
+ spec.add_dependency 'engtagger'
39
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module David
4
+ VERSION = "0.1.1"
5
+ end
data/lib/david.rb ADDED
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "david/version"
4
+ require 'engtagger'
5
+
6
+ module David
7
+ class Error < StandardError; end
8
+ ADJECTIVES = %w(so such very much many).freeze
9
+
10
+ def initialize
11
+ @tagger = EngTagger.new
12
+ end
13
+
14
+ def process(str)
15
+ # Convert input to lowercase.
16
+ str = str.downcase
17
+
18
+ # Extract nouns, prefixing each with one of the
19
+ # above adjectives into sentences of 2 words.
20
+ tagged_str = @tagger.add_tags(str)
21
+ phrases = @tagger.get_nouns(tagged_str).keys
22
+ phrases = phrases.each_with_index.map do |phrase, i|
23
+ "#{adjective(i)} #{phrase}."
24
+ end
25
+
26
+ # End every input with "wow".
27
+ phrases << 'wow.'
28
+
29
+ # Return a string, separating each sentence
30
+ # with a space.
31
+ phrases.join(' ')
32
+ end
33
+
34
+ private
35
+
36
+ def adjective(i)
37
+ ADJECTIVES[i % ADJECTIVES.size]
38
+ end
39
+ end
data/sig/david.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module David
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
data/task/rspec.rake ADDED
@@ -0,0 +1,4 @@
1
+ # tasks/rspec.rake
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: daviddo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - David
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-04-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: engtagger
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Convert everyday boring English into doge speak!
42
+ email:
43
+ - truong.dohuy0501@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - Gemfile
49
+ - Gemfile.lock
50
+ - README.md
51
+ - Rakefile
52
+ - david.gemspec
53
+ - lib/david.rb
54
+ - lib/david/version.rb
55
+ - sig/david.rbs
56
+ - task/rspec.rake
57
+ homepage: https://github.com/truongdohuy0501/david
58
+ licenses:
59
+ - MIT
60
+ metadata:
61
+ homepage_uri: https://github.com/truongdohuy0501/david
62
+ allowed_push_host: https://rubygems.org
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: 2.6.0
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubygems_version: 3.2.3
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: English to doge translations
82
+ test_files: []