sf_cli 1.0.0.beta4 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2cc80df9cc280f3fa0eda5ec72a2972ac5f036d3e9e407030668d984eab92c4
4
- data.tar.gz: d8cd2eb983c18f81825d8bc83fa7cdee78b6c9c725970873d40ed42b52dd0ce4
3
+ metadata.gz: c83fc3297315182771f73c3ff599bfdd9abcff1c72a401d69bc8a734e9c7cd17
4
+ data.tar.gz: 8ed2425d43258abcc43e7ba9ec0dadf1cc18474d47ea286b38998b564cd68e6d
5
5
  SHA512:
6
- metadata.gz: 06153a22706b868d9100f7f2f4f980c3847ee73d793f6649574ebaecf4c68f1bf21245217c432382669448a9f23bf6867772fe5853f1795dcafaa4f28a1428a5
7
- data.tar.gz: 929bca993b4acf6c6a52d07ebe8adcbaa77dfa4b691ce72049e6a71d00e32a1bd79ee7c6211fe083d8d669959166bf3c82f68e7fa9f72eea7548165f7752e37a
6
+ metadata.gz: f97ab229a3000ac570e2d46ccaf393a6f64fd5717587449dede15c149286624b2b37356f7ef5bbe23772a8e8f14519d291b3addfab0114b5963c5831d7f3d604
7
+ data.tar.gz: fb431e461147f16d9a2bac7cf13970f011dc53d77f936dd09a60ed47b2b28259722c3457f435136bfae03673d4bb8df6099ff234852fd03d16c221cf284fe481
data/README.rdoc CHANGED
@@ -63,3 +63,20 @@ With sf command:
63
63
  Doing the same thing independently:
64
64
  contact = Contact.select(:Id, :Name).where(Name: 'Akin Kristen').take
65
65
  contact.Name # Akin Kristen
66
+ == Developer Console
67
+ Developer console integrates both sf_cli's command methods and object model librry into IRB to make scripting easier in REPL.
68
+
69
+ You can directly use sf_cli's command methods:
70
+ $ sf_cli
71
+ > sf.query "SELECT Id, Name FROM Case", target_org: :your_org
72
+
73
+ Object Model is also available:
74
+ > use :your_org_name
75
+ > gen :Account, :Contact, :User #=> generate 3 Object model classes
76
+ > acc = Account.find_by Name: 'Hoge Fuga'
77
+
78
+ There are some other console commands:
79
+ > query "SELECT Id, Name, ... FROM BazBar__c" # just same as `sf data query` with human readable format
80
+ > apex "System.debug('abc');" # execute Apex code instantly
81
+
82
+ Type `help` for the help of all console commands
@@ -10,12 +10,11 @@ module SfCli
10
10
  # Developer Console commands
11
11
  #
12
12
  module Commands
13
- def use(_target_org)
14
- target_org = _target_org.to_sym == :default ? nil : _target_org
13
+ def use(target_org)
15
14
  org_info = sf.org.display target_org: target_org
16
- raise "The connection is not ready. Please check by `sf org list`" unless org_info.connected?
17
-
18
15
  conn = SfCli::Sf::Model::SfCommandConnection.new target_org: target_org, instance_url: org_info.instance_url
16
+ conn.open unless org_info.connected?
17
+
19
18
  SfCli::Sf::Model.set_connection conn
20
19
 
21
20
  available_models.each do |model|
@@ -58,11 +57,11 @@ module SfCli
58
57
  alias :gen :generate
59
58
  alias :conn :connection
60
59
 
61
- def help(command = nil)
60
+ def help
62
61
  conf.inspect_mode = false
63
62
  puts <<~HELP
64
63
  Available commands:
65
- use --- set current org
64
+ use --- set current org.
66
65
  gen --- generate Object model classes
67
66
  query --- Query by SOQL with human readable format
68
67
  apex --- run Apex code
@@ -73,14 +72,14 @@ module SfCli
73
72
  use target-org
74
73
 
75
74
  parameters:
76
- targat-org --- Username or alias of the org you are going to use.
75
+ targat-org --- Username or alias of the org you are going to use. If you are not sure about them, check by `sf org list`.
77
76
 
78
77
  [gen]
79
78
  gen object-name, object-name, ...
80
79
  generate object-name, object-name, ...
81
80
 
82
81
  parameters:
83
- object-name --- Comma separated Names. Symbol or String can be OK. At least 1 object name is required.
82
+ object-name --- Comma separated Names. Symbol or String can be OK. At least 1 object name is required.
84
83
 
85
84
  example:
86
85
  gen :Account, :Contact, :User
@@ -9,6 +9,7 @@ module SfCli
9
9
  #
10
10
  # @see https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_project_commands_unified.htm command reference
11
11
  #
12
+ # @private :nodoc: just for developers
12
13
  module Project
13
14
  # @private :nodoc: just for developers
14
15
  class Core
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sf_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takanobu Maekawa