Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
soumyamahunt committed Mar 6, 2022
0 parents commit e169e31
Show file tree
Hide file tree
Showing 13 changed files with 197 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
pkg
.idea/
13 changes: 13 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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
22 changes: 22 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2022 Soumya Mahunt <soumya.mahunt@tatadigital.com>

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.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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

23 changes: 23 additions & 0 deletions cocoapods-embed-flutter.gemspec
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions lib/cocoapods-embed-flutter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require 'cocoapods-embed-flutter/gem_version'
1 change: 1 addition & 0 deletions lib/cocoapods-embed-flutter/command.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require 'cocoapods-embed-flutter/command/flutter'
44 changes: 44 additions & 0 deletions lib/cocoapods-embed-flutter/command/flutter.rb
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions lib/cocoapods-embed-flutter/gem_version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module CocoapodsEmbedFlutter
VERSION = "0.0.1"
end
1 change: 1 addition & 0 deletions lib/cocoapods_plugin.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require 'cocoapods-embed-flutter/command'
12 changes: 12 additions & 0 deletions spec/command/flutter_spec.rb
Original file line number Diff line number Diff line change
@@ -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

50 changes: 50 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -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

#-----------------------------------------------------------------------------#

0 comments on commit e169e31

Please sign in to comment.