diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4e46fab --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +pkg +.idea/ diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..631d211 --- /dev/null +++ b/Gemfile @@ -0,0 +1,13 @@ +source 'https://rubygems.org' + +# Specify your gem's dependencies in cocoapods-embed-flutter.gemspec +gemspec + +group :development do + gem 'cocoapods' + + gem 'mocha' + gem 'bacon' + gem 'mocha-on-bacon' + gem 'prettybacon' +end diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..7cd9747 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright (c) 2022 Soumya Mahunt + +MIT License + +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/README.md b/README.md new file mode 100644 index 0000000..d005d43 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# cocoapods-embed-flutter + +A description of cocoapods-embed-flutter. + +## Installation + + $ gem install cocoapods-embed-flutter + +## Usage + + $ pod spec flutter POD_NAME diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..c34b828 --- /dev/null +++ b/Rakefile @@ -0,0 +1,13 @@ +require 'bundler/gem_tasks' + +def specs(dir) + FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ') +end + +desc 'Runs all the specs' +task :specs do + sh "bundle exec bacon #{specs('**')}" +end + +task :default => :specs + diff --git a/cocoapods-embed-flutter.gemspec b/cocoapods-embed-flutter.gemspec new file mode 100644 index 0000000..58005ae --- /dev/null +++ b/cocoapods-embed-flutter.gemspec @@ -0,0 +1,23 @@ +# coding: utf-8 +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'cocoapods-embed-flutter/gem_version.rb' + +Gem::Specification.new do |spec| + spec.name = 'cocoapods-embed-flutter' + spec.version = CocoapodsEmbedFlutter::VERSION + spec.authors = ['Soumya Mahunt'] + spec.email = ['soumya.mahunt@tatadigital.com'] + spec.description = %q{A short description of cocoapods-embed-flutter.} + spec.summary = %q{A longer description of cocoapods-embed-flutter.} + spec.homepage = 'https://github.com/EXAMPLE/cocoapods-embed-flutter' + spec.license = 'MIT' + + spec.files = `git ls-files`.split($/) + spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } + spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) + spec.require_paths = ['lib'] + + spec.add_development_dependency 'bundler', '~> 1.3' + spec.add_development_dependency 'rake' +end diff --git a/lib/cocoapods-embed-flutter.rb b/lib/cocoapods-embed-flutter.rb new file mode 100644 index 0000000..3e4a3a3 --- /dev/null +++ b/lib/cocoapods-embed-flutter.rb @@ -0,0 +1 @@ +require 'cocoapods-embed-flutter/gem_version' diff --git a/lib/cocoapods-embed-flutter/command.rb b/lib/cocoapods-embed-flutter/command.rb new file mode 100644 index 0000000..3cb204e --- /dev/null +++ b/lib/cocoapods-embed-flutter/command.rb @@ -0,0 +1 @@ +require 'cocoapods-embed-flutter/command/flutter' diff --git a/lib/cocoapods-embed-flutter/command/flutter.rb b/lib/cocoapods-embed-flutter/command/flutter.rb new file mode 100644 index 0000000..0d7d599 --- /dev/null +++ b/lib/cocoapods-embed-flutter/command/flutter.rb @@ -0,0 +1,44 @@ +module Pod + class Command + # This is an example of a cocoapods plugin adding a top-level subcommand + # to the 'pod' command. + # + # You can also create subcommands of existing or new commands. Say you + # wanted to add a subcommand to `list` to show newly deprecated pods, + # (e.g. `pod list deprecated`), there are a few things that would need + # to change. + # + # - move this file to `lib/pod/command/list/deprecated.rb` and update + # the class to exist in the the Pod::Command::List namespace + # - change this class to extend from `List` instead of `Command`. This + # tells the plugin system that it is a subcommand of `list`. + # - edit `lib/cocoapods_plugins.rb` to require this file + # + # @todo Create a PR to add your plugin to CocoaPods/cocoapods.org + # in the `plugins.json` file, once your plugin is released. + # + class Flutter < Command + self.summary = 'Short description of cocoapods-embed-flutter.' + + self.description = <<-DESC + Longer description of cocoapods-embed-flutter. + DESC + + self.arguments = 'NAME' + + def initialize(argv) + @name = argv.shift_argument + super + end + + def validate! + super + help! 'A Pod name is required.' unless @name + end + + def run + UI.puts "Add your implementation for the cocoapods-embed-flutter plugin in #{__FILE__}" + end + end + end +end diff --git a/lib/cocoapods-embed-flutter/gem_version.rb b/lib/cocoapods-embed-flutter/gem_version.rb new file mode 100644 index 0000000..8fcdc2a --- /dev/null +++ b/lib/cocoapods-embed-flutter/gem_version.rb @@ -0,0 +1,3 @@ +module CocoapodsEmbedFlutter + VERSION = "0.0.1" +end diff --git a/lib/cocoapods_plugin.rb b/lib/cocoapods_plugin.rb new file mode 100644 index 0000000..0f9f239 --- /dev/null +++ b/lib/cocoapods_plugin.rb @@ -0,0 +1 @@ +require 'cocoapods-embed-flutter/command' diff --git a/spec/command/flutter_spec.rb b/spec/command/flutter_spec.rb new file mode 100644 index 0000000..a4c9fb5 --- /dev/null +++ b/spec/command/flutter_spec.rb @@ -0,0 +1,12 @@ +require File.expand_path('../../spec_helper', __FILE__) + +module Pod + describe Command::Flutter do + describe 'CLAide' do + it 'registers it self' do + Command.parse(%w{ flutter }).should.be.instance_of Command::Flutter + end + end + end +end + diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..35da65d --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,50 @@ +require 'pathname' +ROOT = Pathname.new(File.expand_path('../../', __FILE__)) +$:.unshift((ROOT + 'lib').to_s) +$:.unshift((ROOT + 'spec').to_s) + +require 'bundler/setup' +require 'bacon' +require 'mocha-on-bacon' +require 'pretty_bacon' +require 'pathname' +require 'cocoapods' + +Mocha::Configuration.prevent(:stubbing_non_existent_method) + +require 'cocoapods_plugin' + +#-----------------------------------------------------------------------------# + +module Pod + + # Disable the wrapping so the output is deterministic in the tests. + # + UI.disable_wrap = true + + # Redirects the messages to an internal store. + # + module UI + @output = '' + @warnings = '' + + class << self + attr_accessor :output + attr_accessor :warnings + + def puts(message = '') + @output << "#{message}\n" + end + + def warn(message = '', actions = []) + @warnings << "#{message}\n" + end + + def print(message) + @output << message + end + end + end +end + +#-----------------------------------------------------------------------------#