From 401a7c46bbf0aeb015cecf69c29b9f8454f99c0f Mon Sep 17 00:00:00 2001 From: Egor Date: Fri, 21 Feb 2020 16:03:11 +0300 Subject: [PATCH 1/2] sm changes --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 47176a6..5630619 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,6 @@ 1. Слепой метод печати. 1. IDE разработчика: RubyMine, Vim и другие. 1. Git. Git Flow. + +sm changes + From f44bdf72d7ed72cf34723fa564363ad1b68e7b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B3=D0=BE=D1=80?= Date: Thu, 5 Mar 2020 12:35:20 +0300 Subject: [PATCH 2/2] prepare gem to realize methods --- .DS_Store | Bin 0 -> 10244 bytes converter/.DS_Store | Bin 0 -> 6148 bytes converter/Gemfile | 6 ++++ converter/Gemfile.lock | 20 ++++++++++++ converter/LICENSE.txt | 21 +++++++++++++ converter/README.md | 39 +++++++++++++++++++++++ converter/Rakefile | 2 ++ converter/bin/.DS_Store | Bin 0 -> 6148 bytes converter/bin/console | 14 +++++++++ converter/bin/setup | 8 +++++ converter/converter.gemspec | 38 ++++++++++++++++++++++ converter/exe/converter | 49 +++++++++++++++++++++++++++++ converter/lib/.DS_Store | Bin 0 -> 6148 bytes converter/lib/converter.rb | 38 ++++++++++++++++++++++ converter/lib/converter/version.rb | 3 ++ 15 files changed, 238 insertions(+) create mode 100644 .DS_Store create mode 100644 converter/.DS_Store create mode 100644 converter/Gemfile create mode 100644 converter/Gemfile.lock create mode 100644 converter/LICENSE.txt create mode 100644 converter/README.md create mode 100644 converter/Rakefile create mode 100644 converter/bin/.DS_Store create mode 100755 converter/bin/console create mode 100755 converter/bin/setup create mode 100644 converter/converter.gemspec create mode 100755 converter/exe/converter create mode 100644 converter/lib/.DS_Store create mode 100644 converter/lib/converter.rb create mode 100644 converter/lib/converter/version.rb diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7df6516cc612ecffd9be47d64162b641ac74af54 GIT binary patch literal 10244 zcmeHMJ!}&(6n@vHa4A2{fCLk|1qq3&O>${Fph{^-2c%L}gr5OWn`@%d`TU;!o=7RjfKz?n_mm8Sn-_j_o0)r~7LlNrWQR}oCHL2yZ zQ!Bd-FCPD93=Ky{PMtQ*QFHX%=%d^kYvsJW*KB0+^#}B{l=s#g*}ubBdAFZ;?zzR* za_qtlR`v33wOHqq-9iyX9^QAW1=h;2X0_1Z>*NH(G^1v8Id-Ytw(Y5L%TC2R<5qiS zCO&SZ?CDM?YF@mOn7z4D*?7|4>^yymFkmrcWP&mAyxYFQo?@#3uz`J2OZj16{5k#o z%P9`KV!aC6JAlEGfuk7elA((A)^qi0nN>^3rJb2j#sg~LhmI@`iGcmv*Pp9o{MNsT z{k}W`-1^X3e%lAh1uWlQLX}~=YM!&uYSu+>!LKRq}IA9wT5=5kWU8CgXmk8j32$P%|HFn zOZw3pBo{yrEL0gnFL@;Bk=B0bB^6fMLG(uERWg3`{{Gnf^;!h1-qW%D=nazl5A^IK zL65ZdL(f(qlRBwEw)bdLK{v79slf2N$&1>ver}TTyU8HApqp%=%FvfAbtG;=TKl<4 zN@Zow3m}T&aUSL{Y~DgTfdR5`DEmsrEXx1mPw0OC{~wq>y^uygBXIl>Fe2Gp zHiLHUWUzWoq+Gj&bp(jPq{^sjT5DU{j{WAL2(4j;r|)1 Vm&elg{}YpB)%X8FDaxMv|34hs*XaNN literal 0 HcmV?d00001 diff --git a/converter/.DS_Store b/converter/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c46f10e5ba3cac6c41ed2651304b34debd5025b9 GIT binary patch literal 6148 zcmeHKJx{|h5IwgMDq^4`V)Bewx-*0-{DQ6wC{0C?5?l!(v5`N*%>RImjgO6qm0!WT zv(v;1FjffNN%l+M`RtdMD6WafOs|Ux(U^!vXpDnxbl(K$x%FZYm|dXZIp$^VT*>S( zq!j+R1N`iUl+y)W7FXTpCscVpnay3b@;71L+rgE~vb=OTn9-zz`q@|lzx`ORgbR5rL8w^5{%1S5 zE8*bw?eV2?LF&2^`q@}Q$`Ulx0d+tf*pLJKl|_tpJZi5Fr~~T2+5!GPSTx2oVC_*p z9q8l;08Btj;9CAo0WA~2G+^x!48r(Qpf5Gyh+%v=cpJv00c(%GoQ$lDdBVyjoKTFc z4&KUeGO0)H)d6)Nb|4(m$Grca{Cxh8i}aT|pbq>i2TYR9vMFvU?5(|<l} 1.17) + converter! + rake (~> 10.0) + +BUNDLED WITH + 1.17.3 diff --git a/converter/LICENSE.txt b/converter/LICENSE.txt new file mode 100644 index 0000000..2575cf2 --- /dev/null +++ b/converter/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 TODO: Write your name + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/converter/README.md b/converter/README.md new file mode 100644 index 0000000..4bc4db7 --- /dev/null +++ b/converter/README.md @@ -0,0 +1,39 @@ +# Converter + +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/converter`. To experiment with that code, run `bin/console` for an interactive prompt. + +TODO: Delete this and the text above, and describe your gem + +## Installation + +Add this line to your application's Gemfile: + +```ruby +gem 'converter' +``` + +And then execute: + + $ bundle + +Or install it yourself as: + + $ gem install converter + +## Usage + +TODO: Write usage instructions here + +## Development + +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. + +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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). + +## Contributing + +Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/converter. + +## License + +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). diff --git a/converter/Rakefile b/converter/Rakefile new file mode 100644 index 0000000..43022f7 --- /dev/null +++ b/converter/Rakefile @@ -0,0 +1,2 @@ +require "bundler/gem_tasks" +task :default => :spec diff --git a/converter/bin/.DS_Store b/converter/bin/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 1.17" + spec.add_development_dependency "rake", "~> 10.0" +end diff --git a/converter/exe/converter b/converter/exe/converter new file mode 100755 index 0000000..d596515 --- /dev/null +++ b/converter/exe/converter @@ -0,0 +1,49 @@ +#!/usr/bin/env ruby + +require "bundler/setup" +require "converter" +require "optparse" + +options = {} + +gem_spec = Gem::Specification::load("converter.gemspec") + +parser = OptionParser.new do |opt| + opt.banner = "Usage #{gem_spec.name} [options]" + opt.define_head gem_spec.summary + + opt.separator "" + + opt.on("-i", "--input [url]", String) do |input| + options[:input] = input + end + opt.on("-o", "--output-format [rss | json | atom]", String) do |output| + options[:output] = output + end + opt.on("-s", "--sort [asc | desc]", String) do |sort| + options[:sort] = sort + end + opt.on("-f", "--file-name [string]", String) do |file| + options[:file] = file + end + + opt.separator "" + + opt.on("-h", "--help", "Show this message") do |help| + puts opt + exit + end +end + +begin + parser.parse! + puts "The result is %s" % Converter.convert(options) + +rescue OptionParser::InvalidArgument => e + STDERR.puts %Q[#{e.message.capitalize}. Run "#{File.basename($0)}" --help for details.] + exit 1 +rescue KeyError + STDERR.puts %Q[Insufficient arguments. Run "#{File.basename($0)}" --help for details.] + exit 2 +end + diff --git a/converter/lib/.DS_Store b/converter/lib/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..14963f6c9a7d0abe1975a57d79fb0973ce1f9c80 GIT binary patch literal 6148 zcmeHKyKVwO473vpA{xq+`wRJl6@o9|2ckea#7TM8SLM6%Y0TIzf-dQxL1W3DU9V?P zH^upEX1@B|KbbAfYz`;dH^bC;PM_FaWgG~{9k2FgAB_9=N%h|eavyAGgB|VbH-C3{ z8HNLoWl}&2NC7Dz1*E_Q6{zMqUtI7`T_pviz-=hN??ZzVd*PTEpALi=0e~~4!?2E7 z0@#=U_QEj{8JH&(m{hM3!;_ADtGZq|CMMmyh7YeNdrc@FPsjZ&%FTPCq7;w<=L+2C zcFF#~f&VlApOdtc0#e|n6!6)4yI$dys<%#Fj=i?QpW&?efzz-K3PQAFV6